2023-01-17 17:45:54 +01:00
|
|
|
#sub_path_only rewrite ^__PATH__$ __PATH__/ permanent;
|
|
|
|
location __PATH__/ {
|
|
|
|
|
|
|
|
# Path to source
|
|
|
|
alias __FINALPATH__/;
|
|
|
|
|
2023-01-19 20:02:20 +01:00
|
|
|
# Deny access to hidden files and directories
|
|
|
|
location ~ ^/(.+/|)\.(?!well-known\/) {
|
|
|
|
deny all;
|
|
|
|
}
|
2023-01-17 17:45:54 +01:00
|
|
|
|
2023-01-19 20:07:14 +01:00
|
|
|
# Deny access to script folder
|
|
|
|
location ~ ^/(script/.+)\.(.+) {
|
|
|
|
deny all;
|
|
|
|
}
|
|
|
|
|
2023-01-19 20:02:20 +01:00
|
|
|
# Prevent useless logs
|
|
|
|
location = /favicon.ico {
|
|
|
|
log_not_found off;
|
|
|
|
access_log off;
|
|
|
|
}
|
|
|
|
location = /robots.txt {
|
|
|
|
allow all;
|
|
|
|
log_not_found off;
|
|
|
|
access_log off;
|
|
|
|
}
|
2023-01-17 17:45:54 +01:00
|
|
|
|
2023-01-19 20:02:20 +01:00
|
|
|
# Default indexes and catch-all
|
|
|
|
rewrite ^/(connexion|inscription|compte|export)$ /$1.php;
|
|
|
|
index index.html index.php;
|
|
|
|
try_files $uri $uri/ __PATH__/index.php?$args;
|
2023-01-17 17:45:54 +01:00
|
|
|
|
2023-01-19 20:02:20 +01:00
|
|
|
# Execute and serve PHP files
|
|
|
|
location ~ [^/]\.php(/|$) {
|
|
|
|
fastcgi_split_path_info ^(.+?\.php)(/.*)$;
|
|
|
|
fastcgi_pass unix:/var/run/php/php__PHPVERSION__-fpm-__NAME__.sock;
|
|
|
|
fastcgi_index index.php;
|
|
|
|
include fastcgi_params;
|
|
|
|
fastcgi_param REMOTE_USER $remote_user;
|
|
|
|
fastcgi_param PATH_INFO $fastcgi_path_info;
|
|
|
|
fastcgi_param SCRIPT_FILENAME $request_filename;
|
2023-01-17 17:45:54 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
# Include SSOWAT user panel.
|
|
|
|
include conf.d/yunohost_panel.conf.inc;
|
|
|
|
}
|