Loading... ``` #PROXY-START/ location ~* \.(php|jsp|cgi|asp|aspx)$ { proxy_pass https://域名; proxy_set_header Host 域名; #向后端传递访客 ip 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; #向后端传递访客 ip proxy_ssl_name 对方的域名; proxy_ssl_server_name on; } location / { proxy_pass https://域名; proxy_set_header Host 域名; #向后端传递访客 ip 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; #向后端传递访客 ip proxy_ssl_name 域名; proxy_ssl_server_name on; #缓存设置 add_header X-Cache $upstream_cache_status; #Set Nginx Cache proxy_ignore_headers Set-Cookie Cache-Control expires; proxy_cache cache_one; proxy_cache_key $host$uri$is_args$args; proxy_cache_valid 200 304 301 302 120m; expires 12h; } #PROXY-END/ ``` 最后修改:2021 年 04 月 07 日 © 允许规范转载 打赏 赞赏作者 赞 如果觉得我的文章对你有用,请随意赞赏