我的nginx设置是给一个redirect循环

下面是我的Nginx.conf –

#user nobody; worker_processes 1; #error_log logs/error.log; #error_log logs/error.log notice; #error_log logs/error.log info; #pid logs/nginx.pid; events { worker_connections 1024; } http { include mime.types; default_type application/octet-stream; #log_format main '$remote_addr - $remote_user [$time_local] "$request" ' # '$status $body_bytes_sent "$http_referer" ' # '"$http_user_agent" "$http_x_forwarded_for"'; #access_log logs/access.log main; sendfile on; #tcp_nopush on; #keepalive_timeout 0; keepalive_timeout 65; gzip on; gzip_disable "MSIE [1-6]\.(?!.*SV1)"; include /usr/local/nginx/conf/sites-enabled/*; } 

我的网站 – 可用的conf –

 server { listen 80; server_name 1.2.3.4; #server_name abc.in; access_log /usr/local/nginx/logs/abc.access.log; location / { proxy_set_header X-Forwarded-Host $host; proxy_set_header X-Forwarded-Server $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_pass http://localhost:8080/abc; } } 

在浏览器中,inputIP地址和“此网页有redirect循环”消息后,我得到两个斜杠“//”。 任何人都可以请帮我找出问题吗?

谢谢。

尝试阅读文档: http : //wiki.nginx.org/HttpProxyModule

在传递请求时,nginx将proxy_pass指令中指定的位置replace为位置对应的URI部分。

你应该在abc后添加斜杠'/',以便在转换后不会松动它,否则你会得到/abcindex.html而不是/abc/index.html。