-
-
Save andreagrandi/5de9dc9c4eb7e732764c to your computer and use it in GitHub Desktop.
andreagrandi.it nginx configuration
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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