Skip to content

Instantly share code, notes, and snippets.

@knaggit
Last active March 7, 2018 15:31
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save knaggit/4e123010ac03ed6861940eceec541191 to your computer and use it in GitHub Desktop.
Save knaggit/4e123010ac03ed6861940eceec541191 to your computer and use it in GitHub Desktop.
server {
listen 443 default_server ssl http2;
listen [::]:443 default_server ssl http2 ipv6only=on;
root /var/www/starterkit;
index index.php index.html index.htm;
ssl on;
ssl_certificate /etc/nginx/ssl/cf.pem;
ssl_certificate_key /etc/nginx/ssl/cf.key;
ssl_session_timeout 5m;
ssl_protocols SSLv3 TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers "HIGH:!aNULL:!MD5 or HIGH:!aNULL:!MD5:!3DES";
ssl_prefer_server_ciphers on;
server_name kirby.homevoice.io;
location ~ \.php$ {
try_files $uri =404;
fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_script_name;
include fastcgi_params;
}
rewrite ^/(content|site|kirby)$ /error last;
rewrite ^/content/(.*).(txt|md|mdown)$ /error last;
rewrite ^/(site|kirby)/(.*)$ /error last;
location / {
try_files $uri $uri/ /index.php?$uri&$args;
}
location /panel {
try_files $uri $uri/ /panel/index.php?$uri&$args;
}
location ~ (?:^|/)\. {
deny all;
}
location ~ (?:\.(?:bak|config|sql|fla|psd|ini|log|sh|inc|swp|dist)|~)$ {
deny all;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment