Skip to content

Instantly share code, notes, and snippets.

@jtadeulopes
Last active May 30, 2021 14:26
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save jtadeulopes/9189120 to your computer and use it in GitHub Desktop.
Save jtadeulopes/9189120 to your computer and use it in GitHub Desktop.
Nginx config with https support
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