在我的应用程序,cookie的基础上,我将请求转发到特定端口的Apache。 我想是这样的:
server {
listen 80;
server_name example.com;
location /
{
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header X-FORWARDED_PROTO https;
if ($http_cookie ~ 'ver=1' ) {
proxy_pass http://127.0.0.1:6060;
}
else {
proxy_pass http://127.0.0.1:7070;
}
}
}
至于“其他”和“!〜”不准在nginx.conf,我能为这种类型的需求呢?