Skip to content

Instantly share code, notes, and snippets.

@riking
Forked from anonymous/-
Last active August 29, 2015 14:20
Show Gist options
  • Save riking/4cbe6521241cc1106207 to your computer and use it in GitHub Desktop.
Save riking/4cbe6521241cc1106207 to your computer and use it in GitHub Desktop.
server {
listen 80;
listen [::]:80;
server_name www.riking.org; # change this lol
return 301 https://$server_name$request_uri;
}
server {
listen 443 ssl spdy;
listen [::]:443 ssl spdy;
server_name www.riking.org; # change this lol
ssl on;
ssl_certificate /var/www/keys/zarthus.crt;
ssl_certificate_key /var/www/keys/zarthus.key;
ssl_session_tickets on;
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128:AES256:AES:DES-CBC3-SHA:HIGH:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK;
# enable SPDY header compression
spdy_headers_comp 6;
spdy_keepalive_timeout 300; # up from 180 secs default
root /var/www/zarthus;
# Add index.php to the list if you are using PHP
index index.php index.html index.htm;
add_header Strict-Transport-Security "max-age=31536000; includeSubdomains";
server_tokens off;
location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ =404;
}
location ~ \.php$ {
try_files $uri /index.php =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
location ~ /\.ht {
deny all;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment