Skip to content

Instantly share code, notes, and snippets.

@andreagrandi
Last active December 6, 2015 12:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andreagrandi/8b194c99cd3e77fdb5a8 to your computer and use it in GitHub Desktop.
Save andreagrandi/8b194c99cd3e77fdb5a8 to your computer and use it in GitHub Desktop.
Nginx configuration file for andreagrandi.it
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 http2;
listen [::]:443 http2;
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/letsencrypt/live/www.andreagrandi.it/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/www.andreagrandi.it/privkey.pem;
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