#sub_path_only rewrite ^__PATH__$ __PATH__/ permanent; location __PATH__/ { # Path to source alias __FINALPATH__/ ; index index.php; # 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$is_args$args; 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; include /etc/nginx/fastcgi_params; fastcgi_intercept_errors on; fastcgi_param REMOTE_USER $remote_user; fastcgi_param PATH_INFO $fastcgi_path_info; fastcgi_param SCRIPT_FILENAME $request_filename; #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; }