Nginx as a Reverse Proxy

/etc/nginx/proxy.conf example:


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_buffers           32 4k;

Then when I have a site that requires being passed to a proxy, the location looks like this:


location / {
                proxy_pass      http://191.168.1.2/;
                include         /etc/nginx/proxy.conf;
        }

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.