0.proxy_redirect
如果需要修改从被代理服务器传来的应答头中的"Location"和"Refresh"字段,可以用这个指令设置。 假设被代理服务器返回Location字段为: http://localhost:8000/two/some/uri/ 这个指令: proxy_redirect http://localhost:8000/two/ http://frontend/one/; 将Location字段重写为http://frontend/one/some/uri/。 在代替的字段中可以不写服务器名: ———————————————— https://blog.csdn.net/u010391029/article/details/50395680 参数off将在这个字段中禁止所有的proxy_redirect指令:
1.配置
在nginx配置https server { listen 443 ssl http2; ssl certificate /a.crt; ssl_cerficate_key /a/key; ssl_session_timeout 20m; ssl_session_caqche shared:SSL:10m; ssl_protocols TLSv1 TLSv1.1 TLSv1.2; location / { proxy_redirect off; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_pass http://wwlproxy; } }
2.NGINX的proxy_redirect功能比较强大,其作用是对发送给客户端的URL进行修改