Skip to content

Instantly share code, notes, and snippets.

@andreagrandi

andreagrandi/andreagrandi Secret

Last active Feb 12, 2016
Embed
What would you like to do?
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