mirror of
https://github.com/YunoHost-Apps/moncycle_ynh.git
synced 2024-09-03 19:46:16 +02:00
45 lines
1.1 KiB
Nginx Configuration File
45 lines
1.1 KiB
Nginx Configuration File
#sub_path_only rewrite ^__PATH__$ __PATH__/ permanent;
|
|
location __PATH__/ {
|
|
|
|
# Path to source
|
|
alias __INSTALL_DIR__/;
|
|
|
|
# Deny access to hidden files and directories
|
|
location ~ ^/(.+/|)\.(?!well-known\/) {
|
|
deny all;
|
|
}
|
|
|
|
# Deny access to script folder
|
|
location ~ ^/(script/.+)\.(.+) {
|
|
deny all;
|
|
}
|
|
|
|
# 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;
|
|
}
|
|
|
|
# Default indexes and catch-all
|
|
rewrite ^__PATH__/(api/deconnexion|inscription|compte|export)$ __PATH__/$1.php;
|
|
rewrite ^__PATH__/(connexion)$ __PATH__/$1.html;
|
|
index index.html index.php;
|
|
try_files $uri $uri/ __PATH__/index.php?$args;
|
|
|
|
# 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;
|
|
}
|
|
|
|
}
|