1. 程式人生 > >nginx配置記錄

nginx配置記錄

cloud oca red pass server 轉發 proxy val 正常

http請求轉到https

location / {
access_log /usr/local/nginx/logs/access2.log access4;
rewrite ^(.*)$ https://$host$1 permanent; #訪問轉到https
#當502或504時,將請求轉發到負載均衡中正常server中
#proxy_next_upstream http_502 http_504 error timeout invalid_header;
#proxy_pass http://cloudringpy;
#proxy_redirect off;
#proxy_set_header Host $host:80;
#若nginx為最前端時,後端獲得X-Real-IP傳遞的ip即為實際ip,若nginx不是最前端時,實際ip為X-Forwarded-For值。
#proxy_set_header X-Real-IP $remote_addr;
#proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}

nginx配置記錄