Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Below is my 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/;

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/*;

my sites-available conf -

server {
    listen   80;

    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;

On the browser I am getting two slashes "//" after I type in the IP address and the message "This web page has a redirect loop". Can anyone please help me identify the problem please?


share|improve this question
up vote 3 down vote accepted

Try reading documentation:

While passing request nginx replaces URI part which corresponds to location with one indicated in proxy_pass directive.

You should add trailing slash '/' after abc to not loose it after transformation or you will get /abcindex.html, not /abc/index.html.

share|improve this answer
Thank you sir. Adding the "/" worked. Thanks so much! – RockyJ Jun 11 '12 at 14:42

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.