Skip to content

Instantly share code, notes, and snippets.

@luissquall
Last active September 7, 2021 17:59
Show Gist options
  • Save luissquall/d29c1c70011d4a1cf032895e97090a4b to your computer and use it in GitHub Desktop.
Save luissquall/d29c1c70011d4a1cf032895e97090a4b to your computer and use it in GitHub Desktop.
server {
listen 443 ssl;
listen [::]:443 ssl;
server_name {{ domain }};
client_max_body_size 10M;
root {{ webroot }};
index index.php index.html index.htm;
access_log /var/log/nginx/{{ domain }}-ssl.access.log;
error_log /var/log/nginx/{{ domain }}-ssl.error.log;
ssl on;
ssl_certificate {{ ssl_certificate }};
ssl_certificate_key {{ ssl_certificate_key }};
location / {
try_files $uri $uri/ /index.php?$args;
}
location ~ \.php$ {
try_files $uri =404;
include /etc/nginx/fastcgi_params;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_read_timeout 180s;
}
# Deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
location ~ /\.ht {
deny all;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment