2016-10-05 19:44:08 +02:00
|
|
|
location ^~ YNH_WWW_PATH {
|
2017-07-23 13:42:48 +02:00
|
|
|
|
|
|
|
if ($scheme = http) {
|
|
|
|
rewrite ^ https://$server_name$request_uri? permanent;
|
|
|
|
}
|
|
|
|
|
2017-02-27 19:06:31 +01:00
|
|
|
alias YNH_WWW_FINALPATH/;
|
|
|
|
try_files $uri $uri/ /index.php?$query_string;
|
|
|
|
index YNH_WWW_ROOTPATH/index.php;
|
2016-10-05 19:44:08 +02:00
|
|
|
|
2017-02-27 19:06:31 +01:00
|
|
|
# These weird try_files ... see http://stackoverflow.com/a/35102259
|
|
|
|
location YNH_WWW_ROOTPATH/ { try_files $uri $uri/ YNH_WWW_ROOTAPP/index.php?$query_string; }
|
|
|
|
location YNH_WWW_ROOTPATH/api { try_files $uri $uri/ YNH_WWW_ROOTAPP/api.php?$query_string; }
|
|
|
|
location YNH_WWW_ROOTPATH/admin { try_files $uri $uri/ YNH_WWW_ROOTAPP/admin.php?$query_string; }
|
2016-10-05 19:44:08 +02:00
|
|
|
|
2017-02-22 18:05:27 +01:00
|
|
|
location YNH_WWW_ROOTPATH/flarum {
|
2016-10-05 19:44:08 +02:00
|
|
|
deny all;
|
|
|
|
return 404;
|
|
|
|
}
|
|
|
|
|
|
|
|
location ~* \.php$ {
|
|
|
|
fastcgi_split_path_info ^(.+.php)(/.+)$;
|
2017-02-22 19:14:25 +01:00
|
|
|
fastcgi_pass unix:/var/run/php5-fpm-YNH_WWW_APP.sock;
|
2016-10-05 19:44:08 +02:00
|
|
|
include fastcgi_params;
|
2017-02-22 18:53:47 +01:00
|
|
|
fastcgi_param SCRIPT_FILENAME $request_filename;
|
2016-10-05 19:44:08 +02:00
|
|
|
fastcgi_param HTTP_PROXY ""; # Fix for https://httpoxy.org/ vulnerability
|
|
|
|
fastcgi_index index.php;
|
2016-10-08 19:08:37 +02:00
|
|
|
fastcgi_read_timeout 600;
|
2016-10-05 19:44:08 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
location ~* \.html$ {
|
|
|
|
expires -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
location ~* \.(css|js|gif|jpe?g|png)$ {
|
|
|
|
expires 1M;
|
|
|
|
add_header Pragma public;
|
|
|
|
add_header Cache-Control "public, must-revalidate, proxy-revalidate";
|
|
|
|
}
|
|
|
|
|
|
|
|
gzip on;
|
|
|
|
gzip_http_version 1.1;
|
|
|
|
gzip_vary on;
|
|
|
|
gzip_comp_level 6;
|
|
|
|
gzip_proxied any;
|
|
|
|
gzip_types application/atom+xml
|
|
|
|
application/javascript
|
|
|
|
application/json
|
|
|
|
application/vnd.ms-fontobject
|
|
|
|
application/x-font-ttf
|
|
|
|
application/x-web-app-manifest+json
|
|
|
|
application/xhtml+xml
|
|
|
|
application/xml
|
|
|
|
font/opentype
|
|
|
|
image/svg+xml
|
|
|
|
image/x-icon
|
|
|
|
text/css
|
|
|
|
text/plain
|
|
|
|
text/xml;
|
|
|
|
gzip_buffers 16 8k;
|
|
|
|
gzip_disable "MSIE [1-6]\.(?!.*SV1)";
|
|
|
|
|
|
|
|
|
|
|
|
# Include SSOWAT user panel.
|
2017-02-21 21:11:23 +01:00
|
|
|
# include conf.d/yunohost_panel.conf.inc;
|
2016-10-05 19:44:08 +02:00
|
|
|
}
|