#nginx 反向代理域名,会根据启动时候解析出来的ip,加载到内存中,后面不会改变可以绑定hosts或者指定resolve服务器来固定ip #注意proxy最后的斜杠,如果不加会将请求过来的目录带到后端,如果想请求后端的时候访问的是直接域名,就要带这个斜杠 #可以反向代理https和http,https要带端口 #proxy参数要注意,如果后端服务器可以用ip访问没影响,如果后端服务器有多个虚拟域名,单独ip访问不到,就要设置 #proxy_set_header Host "www.test.com"; 这样是通过域名来请求后端资源 location /v/ { include proxy.conf; proxy_pass https://www.test.com:443/; access_log /data/logs/www/test-m-https.log jflog; } #proxy.conf proxy_connect_timeout 300s; proxy_send_timeout 900; proxy_read_timeout 900; proxy_buffer_size 256k; proxy_buffers 4 256k; proxy_busy_buffers_size 256k; proxy_temp_file_write_size 256k; proxy_max_temp_file_size 1024m; proxy_redirect off; proxy_hide_header Vary; proxy_set_header Accept-Encoding ''; proxy_set_header Host "mobile-video.qbaobei.com"; proxy_set_header Referer $http_referer; proxy_set_header Cookie $http_cookie; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; #proxy_next_upstream http_500 http_502 http_503 http_504 http_404 error timeout invalid_header; proxy_next_upstream http_502 http_503 http_504 error timeout invalid_header; proxy_intercept_errors on; #proxy_redirect default; proxy_ignore_client_abort on; add_header Nginx-Cache "$upstream_cache_status";