Nginx Frontend with Apache2 and Drupal6

Larry P. lists at ruby-forum.com
Sat Sep 8 18:16:44 UTC 2012


Hi,

I have a dedicated server running Nginx as a front end and apache2 on
port:8080.  An online game is installed as an application in drupal6.
The site works fine without any issues.  The problem is that when
someone wants to visit the site; it is necessary to enter
'example.com/drupal6'.  I wish to change it so that a visitor only needs
to enter 'example.com' to access the drupal site.  I have tried many
modifications of the Nginx and apache2 configuration files without
success.  I usually end up breaking something.  I would appreciate if
some could offer some advice in this area.

here is how my server is configured.

***NGINX 0.7.67***

********sites-available/default********

server {
  listen   80;
  server_name  mywebsit.com;

  access_log  /var/log/nginx/localhost.access.log;

       location /POLL {
                proxy_pass http://127.0.0.1:8081;
        }

       location /RADIOEDIT_REST {
                proxy_pass http://127.0.0.1:19384/RADIOEDIT_REST;
        }

  location / {
               proxy_pass     http://127.0.0.1:8080;
  }

  location /doc {
    root   /usr/share;
    autoindex on;
    allow 127.0.0.1;
    deny all;
  }

  location /images {
    root   /usr/share;
    autoindex on;
  }

  error_page   500 502 503 504  /50x.html;
  location = /50x.html {
    root   /var/www/nginx-default;
  }
}

********nginx/nginx.conf********

user www-data;
worker_processes  4;

error_log  /var/log/nginx/error.log;
pid        /var/run/nginx.pid;

events {
    worker_connections  1024;
}

http {
    include       /etc/nginx/mime.types;
    default_type  application/octet-stream;

    access_log  /var/log/nginx/access.log;

    sendfile        on;
    #tcp_nopush     on;

    #keepalive_timeout  0;
    keepalive_timeout  65;
    tcp_nodelay        on;

    gzip  on;

    include /etc/nginx/conf.d/*.conf;
    include /etc/nginx/sites-enabled/*;
}

********nginx/conf.d/proxy.conf*******

proxy_redirect          off;
proxy_set_header        Host            $host;
proxy_set_header        X-Real-IP       $remote_addr;
proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_buffering                off;
proxy_read_timeout     300;
proxy_buffers          64 8k;
proxy_buffer_size      128k;

***APACHE2***

********apache2/sites-available/default********

proxy_redirect          off;
proxy_set_header        Host            $host;
proxy_set_header        X-Real-IP       $remote_addr;
proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_buffering                off;
proxy_read_timeout     300;
proxy_buffers          64 8k;
proxy_buffer_size      128k;

********apache2/ports.conf********

# If you just change the port or add more ports here, you will likely
also
# have to change the VirtualHost statement in
# /etc/apache2/sites-enabled/000-default
# This is also true if you have upgraded from before 2.2.9-3 (i.e. from
# Debian etch). See /usr/share/doc/apache2.2-common/NEWS.Debian.gz and
# README.Debian.gz

NameVirtualHost *:8080
Listen 8080

<IfModule mod_ssl.c>
    # If you add NameVirtualHost *:443 here, you will also have to
change
    # the VirtualHost statement in
/etc/apache2/sites-available/default-ssl
    # to <VirtualHost *:443>
    # Server Name Indication for SSL named virtual hosts is currently
not
    # supported by MSIE on Windows XP.
    Listen 443
</IfModule>

<IfModule mod_gnutls.c>
    Listen 443
</IfModule>

********apache2/conf.d/drupal6********

Alias /drupal6 /usr/share/drupal6

<Directory /usr/share/drupal6/>
  Options +FollowSymLinks
  AllowOverride All
  order allow,deny
  allow from all
</Directory>

Thanks in advance!

-- 
Posted via http://www.ruby-forum.com/.



More information about the nginx mailing list