Created
January 22, 2015 17:49
-
-
Save lsgrep/b4a0d771d592044b0460 to your computer and use it in GitHub Desktop.
Nginx Security and Remote Addr
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
server{ | |
listen 80; | |
proxy_connect_timeout 600; | |
proxy_send_timeout 600; | |
proxy_read_timeout 600; | |
send_timeout 600; | |
server_name asdf; | |
location /{ | |
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; | |
proxy_set_header X-Scheme $scheme; | |
proxy_set_header REMOTE_ADDR $remote_addr; | |
proxy_redirect off; | |
proxy_max_temp_file_size 0; | |
proxy_pass http://localhost:3000; | |
} | |
} | |
server{ | |
listen 80; | |
proxy_connect_timeout 600; | |
proxy_send_timeout 600; | |
proxy_read_timeout 600; | |
send_timeout 600; | |
server_name asdfasdf; | |
location / { | |
auth_basic "Restricted"; | |
auth_basic_user_file /var/data/nginx-elastic/.htpasswd; | |
proxy_pass http://127.0.0.1; | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment