Skip to content

Instantly share code, notes, and snippets.

Created October 27, 2017 17:03
Show Gist options
  • Save anonymous/f18b665c74d00f33b5d3efe4943ba978 to your computer and use it in GitHub Desktop.
Save anonymous/f18b665c74d00f33b5d3efe4943ba978 to your computer and use it in GitHub Desktop.
Nginx configuration for withKnown on top of mailinabox
# ...
upstream php-fpm {
server unix:/var/run/php5-fpm.sock;
}
#
server {
listen 443 ssl;
listen [::]:443 ssl;
server_name domain.tld;
# ...
location /css/ {
rewrite ^/css/[0-9]+/(.*) /css/$1 last;
}
location /js/ {
rewrite ^/js/[0-9]+/(.*) /js/$1 last;
}
location ~ (\.ini|known.php)$ {
deny all;
}
client_max_body_size 128M;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location ~ \.php$ {
try_files $uri =404;
include /etc/nginx/fastcgi_params;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_pass php-fpm;
}
}
# ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment