Created
September 27, 2018 15:08
-
-
Save dtelaroli/9ea4c52babdf4f3248ba5dc4c3f63504 to your computer and use it in GitHub Desktop.
Nginx php-fpm docker real origin ip
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# you may use nginx with real ip module | |
server { | |
# your host or vpc cidr_block or the docker gateway address ip | |
set_real_ip_from 10.0.0.0/24; | |
real_ip_header X-Forwarded-For; | |
location ~ \.php$ { | |
# you should pass the header X-Forwarded-For with the real ip from frontend, the AWS ELB/ALB pass by default | |
fastcgi_param REMOTE_ADDR $http_x_forwarded_for; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment