Real IP Address For Nginx BEHIND A REVERSE PROXY or HA Proxy

Firstly you need to configure HAProxy to pass the client IP address, which is quite simply done by adding the “forwardfor” and “http-server-close” options to the backend, ensuring that the real client IP reaches the backend web servers via the X-Forwarded-For header. Here is the configuration I’m using for my HTTP backend:

Server HA Proxy :

example IP : 192.168.0.1

Configuration haproxy.conf

add line backend http :

option http-server-close

option forwardfor

OR Add line :

defaults

option httpclose
option forwardfor

REstart HAPROXY


Server Nginx :

Nginx Webserver

You’ll need to configure and compile Nginx with the –with-http_realip_module option.

Cek Module nginx http_realip_module option ..

Nginx -V

Then set the following option in the Nginx configuration:

Configuration nginx.conf

set_real_ip_from 192.168.0.1; # <- IP HAPROXY

set_real_ip_from 192.168.1.1; # <- IP HAPROXY

real_ip_header X-Forwarded-For;

   REstart Nginx

Posted on: March 6, 2019, by :  | 2 views
https://serang.ut.ac.id/css/css/slot88/ https://tinjut.bagkeu.dikdasmen.kemdikbud.go.id/slot-maxwin/ https://dpm.polinema.ac.id/slot-gacor/ https://akademik.ft.unm.ac.id/slot-dana/ https://ppdb.probolinggokab.go.id/slot-5000/ https://bkad.sulselprov.go.id/assets/ https://ojs.balidwipa.ac.id/docs/slot-gacor/ http://korpri.pekalongankab.go.id/api/slot-gacor/ https://elang.umpp.ac.id/foto/farmasi/-/asset/ http://rsud-kelet.jatengprov.go.id/wp-content/-/asset/ https://kusdhianto-fe.staff.ugm.ac.id/slot88/ http://ppdb.probolinggokab.go.id/judi-bola/ https://bapenda.labuhanbatukab.go.id/racikan-sbobet/ http://rsud-kelet.jatengprov.go.id/wp-content/-/data/ https://agenda.riau.go.id/-/judi-bola/ https://balapan.padang.go.id/sbobet88/ http://jdih.wakatobikab.go.id/sbobet88/ http://kph.menlhk.go.id/sbobet88/ https://bkad.sulselprov.go.id/data/ https://dpm.polinema.ac.id/slot-gacor/ https://dinkes.jemberkab.go.id/storage/attachments/