mengfangui

1、Nginx 正向和反向代理的区别

正向代理和反向代理的区别:正向代理隐藏真实客户端,反向代理隐藏真实服务端,图示:

2、cookie跨域问题

因为cookie存在跨域问题,其中一个解决方法是,设置Nginx代理服务器,将两个服务器域名统一到一个反向代理服务器。

 upstream www.test.com { 
        server 127.0.0.1:8080 weight=1; 
        server 127.0.0.1:8060 weight=1; 
    }

    server {
        listen       80;
        server_name  www.test.com;
        #charset koi8-r;
        #access_log  logs/host.access.log  main;
        location / {
        proxy_pass   http://www.test.com;
        index  index.html index.htm;
        }
    }

3、解决顶级域名与二级域名之间的cookie跨域问题

#通过设置domain
#顶级域名服务器与二级域名服务器之间哪个设置都能生效
#设置完毕后写回到客户端,用另一个服务器即可访问此Cookie
cookie.setDomain("test.com"); 

 

分类:

技术点:

相关文章:

  • 2021-10-29
  • 2021-10-12
  • 2021-06-19
  • 2021-11-22
  • 2022-01-07
  • 2021-12-01
  • 2021-10-15
猜你喜欢
  • 2021-12-06
  • 2021-12-06
  • 2021-12-16
  • 2021-10-19
  • 2021-10-19
  • 2021-10-11
  • 2021-06-09
相关资源
相似解决方案