1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/moncycle_ynh.git synced 2024-09-03 19:46:16 +02:00
moncycle_ynh/conf/nginx.conf

48 lines
1.2 KiB
Nginx Configuration File
Raw Normal View History

2023-01-17 17:45:54 +01:00
#sub_path_only rewrite ^__PATH__$ __PATH__/ permanent;
location __PATH__/ {
# Path to source
2023-09-28 21:02:20 +02:00
alias __INSTALL_DIR__/;
2023-01-17 17:45:54 +01:00
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
2023-01-20 19:00:17 +01:00
location ~ ^/favicon.ico {
2023-01-19 20:02:20 +01:00
log_not_found off;
access_log off;
}
2023-01-20 19:00:17 +01:00
location ~ ^/robots.txt {
2023-01-19 20:02:20 +01:00
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 ^/(export|inscription|compte)$ /$1.php;
rewrite ^/(connexion)$ /$1.html;
rewrite ^/api/(deconnexion)$ /api/$1.php;
rewrite ^/img/(captcha)$ /img/$1.php;
2023-01-19 20:02:20 +01:00
index index.html index.php;
try_files $uri $uri.php $uri/index.php $uri/ $1?$args $1.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
}
}