我正在尝试将除我自己以外的所有流量重定向到着陆页example.com/landing
我的nginx.conf中有一个服务器块,如下所示:
server {
listen 80;
charset utf-8;
if ($bad_referer) {
return 444;
}
location / {
# checks for static file, if not found proxy to app
try_files $uri @proxy_to_app;
}
if ($cookie_dev != "true") {
return 301 http://example.com/landing/;
}
location @proxy_to_app {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_pass http://app;
}
}
但是,我在浏览器中收到“此网页有重定向循环”错误。
你会如何解决这个问题?