【Nginx】--反向代理

最近项目需要访问谷歌服务器,现在谷歌被禁了之后只能通过香港代理,特研究了下ng的反向代理

location /

{

  #配置需要代理访问的地址 proxy_pass https:
//mt0.google.cn;   #配置请求头的host域名 proxy_set_header Host mt0.google.cn; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header REMOTE-HOST $remote_addr; add_header X-Cache $upstream_cache_status; #Set Nginx Cache proxy_set_header Accept-Encoding ""; sub_filter "https://mt0.google.cn" "http://www.xxx.com"; sub_filter_once off; proxy_ignore_headers Set-Cookie Cache-Control expires; add_header Cache-Control no-cache; }

 

posted on 2021-09-03 17:48  Reno灬  阅读(195)  评论(0编辑  收藏  举报

导航