nginx反向代理简单配置
解决同一台电脑上面多个server需要共享80端口或者域名的问题,Apache的二级域名转发规则没研究明白,于是果断nginx了。
server { listen 80; server_name wxpro.orctest.cn; location /sitefiles/ { root D:/nginx/html; } location / { proxy_redirect off; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_pass http://localhost:8080; } error_page 500 502 503 504 /50x.html; location = /50x.html { root html; } access_log logs/wxpro.log; } server{ listen 80; server_name www.orctest.cn; location / { proxy_redirect off; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_pass http://www.orctest.cn:8003; } access_log logs/orchestrallinc.log; } server { listen 80; server_name www.safesoft.cn; location / { proxy_redirect off; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_pass http://www.safesoft.cn:8001; } access_log logs/safesoft.log; }
相关推荐
scaleqiao 2020-10-22
SZStudy 2020-07-04
ssihc0 2020-06-14
某些公司会墙特定网站,如果你有一个可访问的域名和服务器,就可以通过nginx反向代理来来解决这些问题。比如现在我们用mirror.example.com镜像www.baidu.com,以下是详细操作。
byourb 2020-06-05
阳光岛主 2020-06-01
岁月如歌 2020-04-15
carolAnn 2020-04-14
Strongding 2020-04-08
ysmh00 2020-03-27
APCDE 2020-02-21
Freshairx 2020-02-19
tinydu 2020-02-12
carolAnn 2020-02-01
liwf 2020-01-13
nginxs 2020-01-05
Caleb0 2019-12-27
Strongding 2019-12-24