知识
助手
最大化  清空记录  历史记录
   1097  
查询码: 00000236
带目录的nginx配置(解决session刷新问题和basepath问题)
作者: 系统管理员 于 2021年07月02日 发布在分类 / 配置安装 / nginx ,于 2021年07月02日 编辑

worker_processes  1;

events {
    worker_connections  1024;
}


http {
    include       mime.types;
    default_type  application/octet-stream;
    client_max_body_size 20m;
    sendfile        on;

    keepalive_timeout  65;
    
    server {
        listen       9989;
        server_name  127.0.0.1;
		client_max_body_size 2000M;
        location /old/{ #代理到目录
			proxy_pass http://127.0.0.1:8989/;
			proxy_set_header Host $host:$server_port;  #非80端口时要配置 host和端口
			proxy_set_header  X-Real-IP  $remote_addr; #真实ip
			proxy_set_header  X-ContextPath  /old;  #配合wcp的request方法重构,传入contextPath
			
			#proxy_cookie_path /wcp /old;  #解决代理到目录时的cookie刷新问题,把/wcp改写到/old
			#proxy_set_header Cookie $http_cookie; #cookie传递
			#proxy_redirect off;
		}
    }
}
0人参与


 历史版本

修改日期 修改人 备注
2021-07-02 14:12:37[当前版本] 系统管理员 创建版本

wcp知识库系统-京ICP备15024440号-1 -V 5.1.3 -wcp