Last active
May 30, 2021 14:26
-
-
Save jtadeulopes/9189120 to your computer and use it in GitHub Desktop.
Nginx config with https support
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
upstream project { | |
server unix:///var/tmp/project.sock; | |
} | |
server { | |
listen 80 default_server; | |
server_name project.com; | |
return 301 https://$server_name$request_uri; | |
} | |
# Based on https://gist.github.com/plentz/6737338 | |
server { | |
listen 443; | |
server_name project.com; | |
ssl on; | |
ssl_certificate /path/of/my/cert/project.crt; | |
ssl_certificate_key /path/of/my/cert/project.key; | |
ssl_session_cache shared:SSL:10m; | |
ssl_session_timeout 10m; | |
ssl_prefer_server_ciphers on; | |
ssl_protocols TLSv1 TLSv1.1 TLSv1.2; | |
ssl_ciphers 'EECDH+ECDSA+AESGCM EECDH+aRSA+AESGCM EECDH+ECDSA+SHA384 EECDH+ECDSA+SHA256 EECDH+aRSA+SHA384 EECDH+aRSA+SHA256 EECDH+aRSA+RC4 EECDH EDH+aRSA RC4 !aNULL !eNULL !LOW !3DES !MD5 !EXP !PSK !SRP !DSS'; | |
resolver 8.8.8.8; | |
ssl_stapling on; | |
ssl_trusted_certificate /path/of/my/cert/project.crt; | |
location / { | |
root /var/www/project/current/public; | |
if (!-f $request_filename) { | |
proxy_pass http://project; | |
break; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment