1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/framaforms_ynh.git synced 2024-09-03 18:36:12 +02:00
framaforms_ynh/conf/nginx.conf

89 lines
2.1 KiB
Nginx Configuration File
Raw Normal View History

#sub_path_only rewrite ^__PATH__$ __PATH__/ permanent;
location __PATH__/ {
# Path to source
2024-03-16 13:58:59 +01:00
alias __INSTALL_DIR__/app/ ;
2022-04-17 23:24:43 +02:00
2019-06-19 02:18:00 +02:00
index index.php;
2022-04-17 23:24:43 +02:00
2019-06-19 02:18:00 +02:00
if (!-e $request_filename)
{
rewrite ^__PATH__/(.+)$ __PATH__/index.php?q=$1 last;
}
2019-06-14 18:57:58 +02:00
# Common parameter to increase upload size limit in conjunction with dedicated php-fpm file
#client_max_body_size 50M;
try_files $uri $uri/ index.php;
2019-06-19 02:18:00 +02:00
location ~ /favicon.ico {
log_not_found off;
access_log off;
}
location ~ /robots.txt {
allow all;
log_not_found off;
access_log off;
}
# Very rarely should these ever be accessed outside of your lan
location ~* \.(txt|log)$ {
allow 192.168.0.0/16;
deny all;
}
# Allow "Well-Known URIs" as per RFC 5785
location ~* ^/.well-known/ {
allow all;
}
# Block access to "hidden" files and directories whose names begin with a
# period. This includes directories used by version control systems such
# as Subversion or Git to store control files.
location ~ (^|/)\. {
return 403;
}
# Don't allow direct access to PHP files in the vendor directory.
location ~ /vendor/.*\.php$ {
deny all;
return 404;
}
location ~ '[^/]\.php$|^/update.php' {
fastcgi_split_path_info ^(.+?\.php)(/.*)$;
2020-06-03 01:58:54 +02:00
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;
}
2019-06-19 02:18:00 +02:00
# Fighting with Styles? This little gem is amazing.
location ~ ^/sites/.*/files/styles/ {
try_files $uri @rewrite;
}
# Handle private files through Drupal. Private file's path can come
# with a language prefix.
location ~ ^(/[a-z\-]+)?/system/files/ {
2020-10-28 19:03:56 +01:00
rewrite ^((/[a-z\-]+)?/system/files/(.+))$ /index.php?q=$1 last;
2019-06-19 02:18:00 +02:00
}
location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
try_files $uri @rewrite;
expires max;
log_not_found off;
}
# Include SSOWAT user panel.
include conf.d/yunohost_panel.conf.inc;
}
2019-06-19 02:18:00 +02:00
location @rewrite {
rewrite ^/(.*)$ /index.php?q=$1;
}