Created
March 18, 2020 08:41
-
-
Save shov/fa6399c0ab6c5d11706a7481c4a5384f to your computer and use it in GitHub Desktop.
Nginx to Nodejs proxy with SSL
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
server { | |
listen 80; | |
server_name example.com; | |
# Redirect all traffic to SSL | |
rewrite ^ https://$server_name$request_uri? permanent; | |
} | |
server { | |
listen 443 ssl; | |
ssl_protocols SSLv3 TLSv1; | |
ssl_ciphers ALL:!aNULL:!ADH:!eNULL:!LOW:!EXP:RC4+RSA:+HIGH:+MEDIUM; | |
server_name example.com; | |
access_log /var/log/nginx/access.log; | |
error_log /var/log/nginx/error.log info; | |
keepalive_timeout 75 75; | |
ssl_certificate /var/www/certs/example.com.crt; | |
ssl_certificate_key /var/www/certs/example.com.key; | |
ssl_session_timeout 5m; | |
location / { | |
proxy_set_header X-Forwarded-For $remote_addr; | |
proxy_set_header Host $http_host; | |
proxy_pass "https://example.com:9000"; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment