Skip to content

Instantly share code, notes, and snippets.

@andreagrandi
Last active February 12, 2016 23:33
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andreagrandi/5de9dc9c4eb7e732764c to your computer and use it in GitHub Desktop.
Save andreagrandi/5de9dc9c4eb7e732764c to your computer and use it in GitHub Desktop.
andreagrandi.it nginx configuration
server {
listen 80 default_server;
listen [::]:80 default_server ipv6only=on;
server_name andreagrandi.it www.andreagrandi.it;
# Redirect all requests to HTTPS.
return 301 https://$host$request_uri;
}
server {
listen 443;
listen [::]:443;
server_name andreagrandi.it www.andreagrandi.it;
root /var/www/andreagrandi.it;
index index.php index.html index.htm /index.php;
ssl on;
ssl_certificate /etc/nginx/certs/ssl.crt;
ssl_certificate_key /etc/nginx/certs/ssl.key;
ssl_session_timeout 5m;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv3:+EXP;
ssl_prefer_server_ciphers on;
# Matches everything.
location / {
try_files $uri $uri/ /index.php?$args;
autoindex on;
}
location ~ \.php$ {
# PHP specific config.
try_files $uri =404;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param HTTPS on;
fastcgi_param HTTP_SCHEME https;
access_log /var/log/nginx/andreagrandi.access.log;
error_log /var/log/nginx/andreagrandi.error.log;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment