Last active
February 3, 2016 13:37
-
-
Save ar2rsawseen/84045957dd5923f5aedd to your computer and use it in GitHub Desktop.
Nginx https configuration
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 localhost; | |
access_log off; | |
rewrite ^ https://yourdomain.com$request_uri? permanent; | |
} | |
server { | |
listen 443; | |
server_name localhost; | |
access_log off; | |
ssl on; | |
ssl_protocols TLSv1 TLSv1.1 TLSv1.2; | |
ssl_prefer_server_ciphers on; | |
ssl_ciphers 'kEECDH+ECDSA+AES128 kEECDH+ECDSA+AES256 kEECDH+AES128 kEECDH+AES256 kEDH+AES128 kEDH+AES256 DES-CBC3-SHA +SHA !aNULL !eNULL !LOW !kECDH !DSS !MD5 !EXP !PSK !SRP !CAMELLIA !SEED'; | |
ssl_session_cache builtin:1000 shared:SSL:10m; | |
ssl_stapling on; | |
# Use 2048 bit Diffie-Hellman RSA key parameters | |
# (otherwise Nginx defaults to 1024 bit, lowering the strength of encryption # when using PFS) | |
# Generated by OpenSSL with the following command: | |
# openssl dhparam -outform pem -out /etc/nginx/ssl/dhparam2048.pem 2048 | |
ssl_dhparam /etc/nginx/ssl/dhparam2048.pem; | |
ssl_certificate /etc/nginx/ssl/certificate.crt; | |
ssl_certificate_key /etc/nginx/ssl/privatekey.key; | |
location = /i { | |
proxy_pass http://127.0.0.1:3001; | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
proxy_set_header X-Real-IP $remote_addr; | |
} | |
location ^~ /i/ { | |
proxy_pass http://127.0.0.1:3001; | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
proxy_set_header X-Real-IP $remote_addr; | |
} | |
location = /o { | |
proxy_pass http://127.0.0.1:3001; | |
} | |
location ^~ /o/ { | |
proxy_pass http://127.0.0.1:3001; | |
} | |
location / { | |
proxy_pass http://127.0.0.1:6001; | |
proxy_set_header Host $http_host; | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
proxy_set_header X-Real-IP $remote_addr; | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment