Question
nginx proxy protocol how to setup this with elb in front of it.
need your help on nginx proxy protocol as i am not getting visitor client ip. instead getting elb’s ip In nginx logs ec2 server(nginx) ->aws elb proxy_protocol is enabled on elb. when setting same parameter in nginx.conf file it stop listening on 80 and 443 and website not accessible at all. kindly help.
i am not able to get visitor client ip on my website which runs on ec2 instance nginx web server.
when i configure proxy_protocol it dont listen on 80 and 443 and when i remove it it starts listening again and always gives private ip’s generated from aws elb.
kindly help.
Thanks,
Rakesh
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
×
upstream tarmac {
server internal-BAck-123456789.eu-west-1.elb.amazonaws.com;}
server {
listen 80;
server_name example.com;
}
server {
listen 443 ssl defaultserver;
listen [::]:443 ssl defaultserver;
server_name example.com;
sslcertificate /home/deploy/apps/examplecom.pem;
sslcertificatekey /home/deploy/genus/genusappcom.key;
sslprotocols TLSv1 TLSv1.1 TLSv1.2;
sslpreferserverciphers on;
sslciphers AES256+EECDH:AES256+EDH:!aNULL;
#root /dev/null;
accesslog /var/log/nginx/nginx.access.log;
errorlog /var/log/nginx/nginx.error.log;
location / {
proxysetheader X-Scheme $scheme;
proxysetheader X-Forwarded-Proto https;
proxysetheader X-Forwarded-For $proxyaddxforwardedfor;
proxysetheader Host $httphost;
proxysetheader Accept-Encoding “”;
proxysetheader X-Real-IP $remoteaddr;
#proxyredirect off;
proxyignoreclientabort on;
}
Hi All ,
I am trying to setup ALB->NGINX->ALB->APACHE, the above is nginx config it work fine we ALB is removed in front nginx , but fails to load when ALB attached in front of nginx can help me out in this, please