GolangNote

Golang笔记

用nginx 反向代理golang 官方的文档网站

Permalink

nginx 反向代理很高效,可以在自己国外的VPS 上做一个简单的配置。

nginx 反向代理

反向代理的经典配置:

INI: nginx 反向代理配置
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
server {
    listen       80;
    server_name  doc.golangnote.com;

    location / {
        proxy_redirect off;
        # proxy_set_header Host $host;
        proxy_set_header Host "golang.org";
        proxy_pass http://golang.org;
        proxy_set_header  X-Real-IP  $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        access_log off;
        error_log off;
    }

}

本文网址: https://golangnote.com/topic/23.html 转摘请注明来源

Related articles

Golang phantomjs 动态代理实现

phantomjs 是个很优秀的软件,虽然现在被chrome headless 抢了风头,但在某些特定场合,使用phantomjs 还是很方便,这里是介绍使用Go 实现动态代理。...

Golang实现简单的Socks5代理

Socks5 代理较 `http/https` 代理有较好的性能,下面是借鉴某个著名开源软件的 local 实现的简单代理。...

Write a Comment to "用nginx 反向代理golang 官方的文档网站"

Submit Comment Login
Based on Golang + fastHTTP + sdb | go1.20 Processed in 0ms