Nginx reverse proxy with IP-Based vhosts apache

Jamie Quint jsquintz at gmail.com
Fri Jan 18 12:34:51 MSK 2008


Hi,

I'm looking for comments on my nginx.conf file. I am using nginx to serve
some static content and proxy to apache for some other requests however I
think there is something wrong with my proxypass settings.

If I use apache's name based virtual hosts everything works out great,
however if I use IP based virtual hosts, apache does not direct to the right
virtual host, instead just defaulting to the main Document Root. I can't
seem to find an answer on Google anywhere, so any feedback is greatly
appreciated (relevant part of nginx.conf below).

        location / {
            proxy_pass         http://127.0.0.1:8080/;
            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;

            client_max_body_size       10m;
            client_body_buffer_size    128k;

            proxy_connect_timeout      90;
            proxy_send_timeout         90;
            proxy_read_timeout         90;

            proxy_buffer_size          4k;
            proxy_buffers              4 32k;
            proxy_busy_buffers_size    64k;
            proxy_temp_file_write_size 64k;
        }
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://nginx.org/pipermail/nginx/attachments/20080118/9a795a1c/attachment.html>


More information about the nginx mailing list