Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have hosted different drupal sites in an Ubuntu server. Nginx is running as a webserver in this server.All sites are working fine. For security reasons i need to enable a Nginx proxy server ahead of the above server. Configured proxy. The following is the configuration file that i used for proxying . The result of this is when i access the url www.drupal.com it redirect to http://www.drupalsite.com.

server {
  listen 80;
  server_name  www.drupal.com;

  location / {

    proxy_set_header Host $proxy_host;
    proxy_set_header Connection Close;
    proxy_pass http://www.drupalsite.com;
    proxy_redirect  /    /;
  }
}

I don't need url redirection. i need the base url is www.drupal.com

share|improve this question
add comment

1 Answer

If 'nginx' is running on the same host as http://www.drupalsite.com, then you have conflict because they are both attempting to use port 80. If that's the issue, you need to move drupalsite.com to a new port or a new server.

Also, try removing "proxy_set_header" and "proxy_redirect" directives. They are not essential.

As always, check your access your access and error logs to see if they shed light on what's happening.

share|improve this answer
    
www.drupal.com and www.drupalsite.com is running in different server. So both are running on port 80 in different server. –  roni Aug 2 '12 at 12:57
    
Also, try removing "proxy_set_header" and "proxy_redirect" directives. They are not essential. –  Mark Stosberg Aug 2 '12 at 13:00
add comment

Your Answer

 
discard

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.