mirror of
https://github.com/YunoHost-Apps/drupal_ynh.git
synced 2024-09-03 18:35:53 +02:00
Cleanup nginx conf
This commit is contained in:
parent
afe79e8c89
commit
5d60c5d3bf
1 changed files with 11 additions and 11 deletions
|
@ -2,7 +2,7 @@
|
||||||
location __PATH__/ {
|
location __PATH__/ {
|
||||||
|
|
||||||
# Path to source
|
# Path to source
|
||||||
alias __INSTALL_DIR__/__NAME__/ ;
|
alias __INSTALL_DIR__/__NAME__/;
|
||||||
index index.php;
|
index index.php;
|
||||||
if (!-e $request_filename)
|
if (!-e $request_filename)
|
||||||
{
|
{
|
||||||
|
@ -12,45 +12,45 @@ location __PATH__/ {
|
||||||
index index.php;
|
index index.php;
|
||||||
|
|
||||||
# Common parameter to increase upload size limit in conjunction with dedicated php-fpm file
|
# Common parameter to increase upload size limit in conjunction with dedicated php-fpm file
|
||||||
client_max_body_size 50M;
|
client_max_body_size 500M;
|
||||||
|
|
||||||
try_files $uri $uri/ index.php;
|
try_files $uri $uri/ index.php;
|
||||||
|
|
||||||
location ~ /favicon.ico {
|
location ~ /favicon.ico {
|
||||||
log_not_found off;
|
log_not_found off;
|
||||||
access_log off;
|
access_log off;
|
||||||
}
|
}
|
||||||
|
|
||||||
location ~ /robots.txt {
|
location ~ /robots.txt {
|
||||||
allow all;
|
allow all;
|
||||||
log_not_found off;
|
log_not_found off;
|
||||||
access_log off;
|
access_log off;
|
||||||
}
|
}
|
||||||
|
|
||||||
# Very rarely should these ever be accessed outside of your lan
|
# Very rarely should these ever be accessed outside of your lan
|
||||||
location ~* \.(txt|log)$ {
|
location ~* \.(txt|log)$ {
|
||||||
allow 192.168.0.0/16;
|
allow 192.168.0.0/16;
|
||||||
deny all;
|
deny all;
|
||||||
}
|
}
|
||||||
|
|
||||||
# Allow "Well-Known URIs" as per RFC 5785
|
# Allow "Well-Known URIs" as per RFC 5785
|
||||||
location ~* ^/.well-known/ {
|
location ~* ^/.well-known/ {
|
||||||
allow all;
|
allow all;
|
||||||
}
|
}
|
||||||
|
|
||||||
# Block access to "hidden" files and directories whose names begin with a
|
# Block access to "hidden" files and directories whose names begin with a
|
||||||
# period. This includes directories used by version control systems such
|
# period. This includes directories used by version control systems such
|
||||||
# as Subversion or Git to store control files.
|
# as Subversion or Git to store control files.
|
||||||
location ~ (^|/)\. {
|
location ~ (^|/)\. {
|
||||||
return 403;
|
return 403;
|
||||||
}
|
}
|
||||||
|
|
||||||
# Don't allow direct access to PHP files in the vendor directory.
|
# Don't allow direct access to PHP files in the vendor directory.
|
||||||
location ~ /vendor/.*\.php$ {
|
location ~ /vendor/.*\.php$ {
|
||||||
deny all;
|
deny all;
|
||||||
return 404;
|
return 404;
|
||||||
}
|
}
|
||||||
|
|
||||||
location ~ '[^/]\.php$|^/update.php' {
|
location ~ '[^/]\.php$|^/update.php' {
|
||||||
fastcgi_split_path_info ^(.+?\.php)(/.*)$;
|
fastcgi_split_path_info ^(.+?\.php)(/.*)$;
|
||||||
fastcgi_pass unix:/var/run/php/php__PHPVERSION__-fpm-__NAME__.sock;
|
fastcgi_pass unix:/var/run/php/php__PHPVERSION__-fpm-__NAME__.sock;
|
||||||
|
@ -61,12 +61,12 @@ location __PATH__/ {
|
||||||
fastcgi_param PATH_INFO $fastcgi_path_info;
|
fastcgi_param PATH_INFO $fastcgi_path_info;
|
||||||
fastcgi_param SCRIPT_FILENAME $request_filename;
|
fastcgi_param SCRIPT_FILENAME $request_filename;
|
||||||
}
|
}
|
||||||
|
|
||||||
# Fighting with Styles? This little gem is amazing.
|
# Fighting with Styles? This little gem is amazing.
|
||||||
location ~ ^/sites/.*/files/styles/ {
|
location ~ ^/sites/.*/files/styles/ {
|
||||||
try_files $uri @rewrite;
|
try_files $uri @rewrite;
|
||||||
}
|
}
|
||||||
|
|
||||||
# Handle private files through Drupal. Private file's path can come
|
# Handle private files through Drupal. Private file's path can come
|
||||||
# with a language prefix.
|
# with a language prefix.
|
||||||
location ~ ^(/[a-z\-]+)?/system/files/ {
|
location ~ ^(/[a-z\-]+)?/system/files/ {
|
||||||
|
|
Loading…
Add table
Reference in a new issue