nginx配置学习记录

  • garens 

nginx中,当配置代理的时候,有时候会出现代理的网址能打开,但登录的时候无法登录,可能的原因是session的问题,在代理的配置文件中加入以下代码可以解决问题:

proxy_pass http://127.0.0.1:9080/app/;

proxy_cookie_path /app/ /;
proxy_cookie_path /app/;
proxy_set_header Host $host;
proxy_set_header X-real-ip $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
Tags:

Leave a Reply

Your email address will not be published. Required fields are marked *