nginx代理域名访问
host文件修改
首先将域名映射为nginx的服务器
127.0.0.1 service.tourbida.com
nginx域名代理
将域名代理到另外一个域名.
server {
listen 80;
server_name service.tourbida.com;
location / {
# 代理到具体IP
# proxy_pass http://127.0.0.1:6888/;
# 代理到某个域名
proxy_pass http://service.tbd.yanzuoguang.com/;
proxy_redirect off;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
}
本文由 创作,采用 知识共享署名4.0 国际许可协议进行许可。本站文章除注明转载/出处外,均为本站原创或翻译,转载前请务必署名。最后编辑时间为: 2021/04/28 09:00