Last active
May 31, 2017 03:33
-
-
Save dblackdblack/8ee26ab2216cabe411143c349150e6b3 to your computer and use it in GitHub Desktop.
This file contains 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
# https://superuser.com/a/1060873 | |
map $http_x_forwarded_for $allowed { | |
default false; | |
~(^|,|\s)54.68.161.228$ true; | |
~(^|,|\s)10.200.\d+.\d+$ true; | |
"" true; # for internal-to-internal traffic, X-Forwarded-For is unset | |
} | |
server { | |
listen 80; | |
server_name localhost; | |
location / { | |
if ($allowed = false) { | |
return 403; | |
} | |
root /usr/share/nginx/html; | |
index index.html index.htm; | |
} | |
error_page 500 502 503 504 /50x.html; | |
location = /50x.html { | |
root /usr/share/nginx/html; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment