CentOS 7
Sponsored Link

Nginx : Reverse Proxy Settings#12015/08/18

Configure Nginx for Reverse Proxy Settings.
[1] For example, Configure that HTTP connection to Nginx on port 80 are forwarded to the backend Apache httpd server.
[root@www ~]#
vi /etc/nginx/nginx.conf
# change like follows in "server" section

    server {
        listen      80 default_server;
        listen      [::]:80 default_server;
        server_name www.srv.world;

        proxy_redirect           off;
        proxy_set_header         X-Real-IP $remote_addr;
        proxy_set_header         X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header         Host $http_host;

        location / {
            proxy_pass http://node01.srv.world/;

[root@www ~]#
systemctl restart nginx

[2] Change httpd settings on Backends to logging X-Forwarded-For header.
[root@node01 ~]#
vi /etc/httpd/conf/httpd.conf
# line 196: change

LogFormat "
%l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
[root@node01 ~]#
systemctl restart httpd

[3] Make sure all works fine to access to the Nginx server from a Client with HTTP like follows.
Matched Content