We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
有时项目上线后,出现线上问题,依赖线上数据,但不方便调试定位问题。 线上资源反向代理,有两种方式: 一是通过fiddle、charles进行本地资源代理,参考:https://blog.csdn.net/weixin_39966065/article/details/99331857 二是通过nginx进行域名反向代理。 本文介绍nginx反向代理
对 http://abc.bigo.sg 进行反向代理。
nginx配置如下:
server { listen 80; server_name abc.bigo.sg; access_log /tmp/access.log main; error_log /tmp/error.log error; location ^~ /api/ { # 数据接口不代理 proxy_pass http://123.456.78:80; # ping abc.bigo.sg 获取到的实际ip地址 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host abc.bigo.sg; } location / { proxy_pass http://127.0.0.1:3020; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } }
检验配置:nginx -t
重启服务:nginx -s reload
添加host 127.0.0.1 abc.bigo.sg
新开隐身窗口访问站点(避免dns缓存) http://abc.bigo.sg
代理成功
The text was updated successfully, but these errors were encountered:
No branches or pull requests
前言
有时项目上线后,出现线上问题,依赖线上数据,但不方便调试定位问题。
线上资源反向代理,有两种方式:
一是通过fiddle、charles进行本地资源代理,参考:https://blog.csdn.net/weixin_39966065/article/details/99331857
二是通过nginx进行域名反向代理。
本文介绍nginx反向代理
1.流程图说明
2.操作实例
对 http://abc.bigo.sg 进行反向代理。
nginx配置如下:
检验配置:nginx -t
重启服务:nginx -s reload
添加host
127.0.0.1 abc.bigo.sg
新开隐身窗口访问站点(避免dns缓存)
http://abc.bigo.sg
代理成功
The text was updated successfully, but these errors were encountered: