mirror of
https://github.com/YunoHost-Apps/prestashop_ynh.git
synced 2024-09-03 20:06:39 +02:00
Update nginx.conf
This commit is contained in:
parent
eb3dd4d23e
commit
9b54f8665b
1 changed files with 61 additions and 1 deletions
|
@ -9,7 +9,8 @@ location __PATH__/ {
|
|||
# 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;
|
||||
try_files $uri $uri/ /index.php$is_args$args;
|
||||
|
||||
location ~ [^/]\.php(/|$) {
|
||||
fastcgi_split_path_info ^(.+?\.php)(/.*)$;
|
||||
fastcgi_pass unix:/var/run/php/php__PHPVERSION__-fpm-__NAME__.sock;
|
||||
|
@ -26,6 +27,65 @@ location __PATH__/ {
|
|||
#fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
||||
}
|
||||
|
||||
|
||||
# Images.
|
||||
rewrite ^/(\d)(-[\w-]+)?/.+\.jpg$ /img/p/$1/$1$2.jpg last;
|
||||
rewrite ^/(\d)(\d)(-[\w-]+)?/.+\.jpg$ /img/p/$1/$2/$1$2$3.jpg last;
|
||||
rewrite ^/(\d)(\d)(\d)(-[\w-]+)?/.+\.jpg$ /img/p/$1/$2/$3/$1$2$3$4.jpg last;
|
||||
rewrite ^/(\d)(\d)(\d)(\d)(-[\w-]+)?/.+\.jpg$ /img/p/$1/$2/$3/$4/$1$2$3$4$5.jpg last;
|
||||
rewrite ^/(\d)(\d)(\d)(\d)(\d)(-[\w-]+)?/.+\.jpg$ /img/p/$1/$2/$3/$4/$5/$1$2$3$4$5$6.jpg last;
|
||||
rewrite ^/(\d)(\d)(\d)(\d)(\d)(\d)(-[\w-]+)?/.+\.jpg$ /img/p/$1/$2/$3/$4/$5/$6/$1$2$3$4$5$6$7.jpg last;
|
||||
rewrite ^/(\d)(\d)(\d)(\d)(\d)(\d)(\d)(-[\w-]+)?/.+\.jpg$ /img/p/$1/$2/$3/$4/$5/$6/$7/$1$2$3$4$5$6$7$8.jpg last;
|
||||
rewrite ^/(\d)(\d)(\d)(\d)(\d)(\d)(\d)(\d)(-[\w-]+)?/.+\.jpg$ /img/p/$1/$2/$3/$4/$5/$6/$7/$8/$1$2$3$4$5$6$7$8$9.jpg last;
|
||||
rewrite ^/c/([\w.-]+)/.+\.jpg$ /img/c/$1.jpg last;
|
||||
|
||||
# AlphaImageLoader for IE and FancyBox.
|
||||
rewrite ^images_ie/?([^/]+)\.(gif|jpe?g|png)$ js/jquery/plugins/fancybox/images/$1.$2 last;
|
||||
|
||||
# Web service API.
|
||||
rewrite ^/api/?(.*)$ /webservice/dispatcher.php?url=$1 last;
|
||||
|
||||
# Installation sandbox.
|
||||
rewrite ^(/install(?:-dev)?/sandbox)/.* /$1/test.php last;
|
||||
|
||||
|
||||
# [EDIT] Replace 'admin-dev' in this block with the name of your admin directory.
|
||||
#https://stackoverflow.com/questions/16262497/how-to-get-prestashop-admin-dir-admin-url
|
||||
location /admin-dev/ {
|
||||
if (!-e $request_filename) {
|
||||
rewrite ^ /admin-dev/index.php last;
|
||||
}
|
||||
}
|
||||
|
||||
# .htaccess, .DS_Store, .htpasswd, etc.
|
||||
location ~ /\. {
|
||||
deny all;
|
||||
}
|
||||
|
||||
# Source code directories.
|
||||
location ~ ^/(app|bin|cache|classes|config|controllers|docs|localization|override|src|tests|tools|translations|var|vendor)/ {
|
||||
deny all;
|
||||
}
|
||||
|
||||
# vendor in modules directory.
|
||||
location ~ ^/modules/.*/vendor/ {
|
||||
deny all;
|
||||
}
|
||||
|
||||
# Prevent exposing other sensitive files.
|
||||
location ~ \.(log|tpl|twig|sass|yml)$ {
|
||||
deny all;
|
||||
}
|
||||
|
||||
# Prevent injection of PHP files.
|
||||
location /img {
|
||||
location ~ \.php$ { deny all; }
|
||||
}
|
||||
|
||||
location /upload {
|
||||
location ~ \.php$ { deny all; }
|
||||
}
|
||||
|
||||
# Include SSOWAT user panel.
|
||||
include conf.d/yunohost_panel.conf.inc;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue