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:
parent
aaea75aadd
commit
d15105f38d
1 changed files with 21 additions and 0 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue