1
在我的應用程序中,基於cookie,我必須將請求轉發到某個apache端口。我想是這樣的:替代else運算符和不等於nginx運算符
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允許,我能爲這種類型的要求完成「〜!」?