Last active
July 11, 2016 14:52
-
-
Save vancouverwill/0f025f0024c9421c28cf0a04bcf9ca7f to your computer and use it in GitHub Desktop.
Sample NGINX configuration for redirect proxy server
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
user nginx; | |
worker_processes 1; | |
events { worker_connections 1024; } | |
http { | |
sendfile on; | |
server { | |
listen 443 ssl; | |
#servername localhost; | |
client_max_body_size 20m; | |
client_header_timeout 1200; | |
client_body_timeout 1200; | |
send_timeout 1200; | |
keepalive_timeout 1200; | |
ssl_certificate dummy.cert; | |
ssl_certificate_key dummy.cert.key; | |
ssl_protocols TLSv1 TLSv1.1 TLSv1.2; | |
ssl_ciphers HIGH:!aNULL:!MD5; | |
# openssl req -new -newkey rsa:2048 -nodes -keyout dummy.cert.key -out dummy.csr | |
# sudo openssl x509 -req -days 365 -in dummy.csr -signkey dummy.cert.key -out dummy.cert | |
access_log /var/log/nginx/access.log combined; | |
error_log /var/log/nginx/error.log warn; | |
# this is the important part for the proxy server, instead of serving a local applicatin I am are redirecting all traffic to a different instance | |
location / { | |
proxy_pass https://xx.xx.xx.xx:443; | |
proxy_set_header X-Forwarded-For $remote_addr; | |
proxy_set_header Host $http_host; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment