nginx rewrite 导致验证码不正确
2016-01-07 10:56
633 查看
配置nginx里url rewrite的时候,为了使浏览器地址栏的URL保持不变,
使用proxy_pass反向代理,但发现每次都会生成新的jsessionid
解决方法,配置中增加
This directive appeared in version 1.1.15.
Sets a text that should be changed in the
will rewrite this attribute to “
The
The directive can also be specified using regular expressions. In this case,
There could be several
The
使用proxy_pass反向代理,但发现每次都会生成新的jsessionid
解决方法,配置中增加
proxy_cookie_path /two/ /; 官网说明如下:
Syntax: | proxy_cookie_pathoff; proxy_cookie_path;[/code]path[code]replacement |
---|---|
Default: | proxy_cookie_path off; |
Context: | http, server, location |
Sets a text that should be changed in the
pathattribute of the “Set-Cookie” header fields of a proxied server response. Suppose a proxied server returned the “Set-Cookie” header field with the attribute “
path=/two/some/uri/”. The directive
proxy_cookie_path /two/ /;
will rewrite this attribute to “
path=/some/uri/”.
The
pathand
replacementstrings can contain variables:
proxy_cookie_path $uri /some$uri;
The directive can also be specified using regular expressions. In this case,
pathshould either start from the “
~” symbol for a case-sensitive matching, or from the “
~*” symbols for case-insensitive matching. The regular expression can contain named and positional captures, and
replacementcan reference them:
proxy_cookie_path ~*^/user/([^/]+) /u/$1;
There could be several
proxy_cookie_pathdirectives:
proxy_cookie_path /one/ /; proxy_cookie_path / /two/;
The
offparameter cancels the effect of all
proxy_cookie_pathdirectives on the current level:
proxy_cookie_path off;
proxy_cookie_path /two/ /;proxy_cookie_path ~*^/user/([^/]+) /u/$1;
相关文章推荐
- 为运行中的nginx添加模块
- linux中 Nginx 常见502错误问题解决办法
- Nginx负载均衡代码之加权轮询
- 降低Nginx代理服务器的磁盘IO使用率,提高转发性能
- LNMP实现(CentOS7+Nginx-1.9.4+PHP-5.6+MySQL-5.6.26)
- Nginx+Keepalived实现
- nginx压力测试使用webbench
- 阿里云服务器使用OneinStack的lnmp一键安装包后查看nginx的并发数
- nginx queue设计
- Nginx配置文件详细说明
- Nginx服务器中为网站或目录添加认证密码的配置详解
- nginx的配置问题
- nginx配置文件强制下载
- django+uwsgi+nginx ajax post 504 Gateway Time-out
- Windows系统下安装配置Nginx
- CentOS6下基于Nginx搭建mp4/flv流媒体服务器(可随意拖动)并支持RTMP/HLS协议(含转码工具)
- nginx常见502问题的解决
- linux下安装nginx
- Nginx使用
- Java项目部署总结(三)nginx安装与配置