1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/dokuwiki_ynh.git synced 2024-09-03 18:26:20 +02:00

[enh] Nginx conf improvments (security, static files cache).

This commit is contained in:
opi 2014-07-20 15:28:18 +02:00
parent aaea75aadd
commit d15105f38d

View file

@ -1,10 +1,15 @@
location YNH_WWW_PATH {
alias YNH_WWW_ALIAS ;
# Force https
if ($scheme = http) {
rewrite ^ https://$server_name$request_uri? permanent;
}
index index.php;
try_files $uri $uri/ index.php;
location ~ [^/]\.php(/|$) {
fastcgi_split_path_info ^(.+?\.php)(/.*)$;
fastcgi_pass unix:/var/run/php5-fpm.sock;
@ -14,6 +19,22 @@ location YNH_WWW_PATH {
fastcgi_param PATH_INFO $fastcgi_path_info;
}
# Secure DokuWiki
location ~ ^/dokuwiki/(data|conf|bin|inc)/ {
deny all;
}
# Deny Access to htaccess-Files for Apache
location ~ /\.ht {
deny all;
}
# Serve static files
location ~ ^/lib.*\.(gif|png|ico|jpg)$ {
expires 30d;
}
# Include SSOWAT user panel.
include conf.d/yunohost_panel.conf.inc;
}