Skip to content

Instantly share code, notes, and snippets.

@seandelaney
Forked from kevindees/nginx-server-template.conf
Last active January 26, 2023 18:05
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 seandelaney/4da7258121f60cad4e0ceb7cd1890098 to your computer and use it in GitHub Desktop.
Save seandelaney/4da7258121f60cad4e0ceb7cd1890098 to your computer and use it in GitHub Desktop.
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
ssl_certificate /usr/local/etc/nginx/ssl/{{host}}.crt;
ssl_certificate_key /usr/local/etc/nginx/ssl/{{host}}.key;
ssl_ciphers HIGH:!aNULL:!MD5;
charset utf-8;
server_name {{host}};
root {{root}};
index index.php;
location = /favicon.ico { access_log off; log_not_found off; }
location = /robots.txt { access_log off; log_not_found off; }
include /usr/local/etc/nginx/craftcms/security.conf;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
include /usr/local/etc/nginx/craftcms/redirections.conf;
include /usr/local/etc/nginx/craftcms/general.conf;
include /usr/local/etc/nginx/craftcms/gzip.conf;
location ~ \.php$ {
include /usr/local/etc/nginx/craftcms/php_fastcgi.conf;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment