Skip to content

Instantly share code, notes, and snippets.

@Darkflib
Created April 13, 2016 10:45
Show Gist options
  • Select an option

  • Save Darkflib/502fc4171cbb37486605553251208697 to your computer and use it in GitHub Desktop.

Select an option

Save Darkflib/502fc4171cbb37486605553251208697 to your computer and use it in GitHub Desktop.
##
# SSL Settings
##
ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # Dropping SSLv3, ref: POODLE
ssl_prefer_server_ciphers on;
ssl_session_cache shared:SSL:10m;
ssl_ciphers "EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH";
ssl_ecdh_curve secp384r1;
ssl_session_tickets off;
ssl_stapling on;
ssl_stapling_verify on;
ssl_dhparam certs/dhparams.pem; # need to generate this. openssl dhparam -out certs/dhparams.pem 4096
resolver 127.0.0.1;
server {
listen 80;
# SSL configuration
#
listen 443 ssl;
#
# Note: You should disable gzip for SSL traffic.
# See: https://bugs.debian.org/773332
#
# Read up on ssl_ciphers to ensure a secure configuration.
# See: https://bugs.debian.org/765782
#
# Self signed certs generated by the ssl-cert package
# Don't use them in a production server!
#
# include snippets/snakeoil.conf;
ssl_certificate /etc/nginx/certs/foo.cert;
ssl_certificate_key /etc/nginx/certs/foo.key;
add_header Strict-Transport-Security "max-age=63072000; includeSubdomains; preload";
add_header X-Frame-Options DENY;
add_header X-Content-Type-Options nosniff;
root /var/www/twitter-test/public/;
index index.html index.htm index.php;
server_name foo.com;
location / {
try_files $uri $uri/ index.php;
}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
location ~ \.php$ {
include snippets/fastcgi-php.conf;
# With php5-fpm:
fastcgi_pass unix:/var/run/php5-fpm.sock;
}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
location ~ /\.ht {
deny all;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment