server{listen80;listen443sslhttp2;server_nameexample.comwww.example.com;root/var/www/html/example.com;indexindex.php;# SSL parameters
ssl_certificate/etc/letsencrypt/live/example.com/fullchain.pem;ssl_certificate_key/etc/letsencrypt/live/example.com/privkey.pem;ssl_trusted_certificate/etc/letsencrypt/live/example.com/chain.pem;includesnippets/ssl.conf;includesnippets/letsencrypt.conf;# Cloudflare / Max CDN fix
location~*\.(eot|otf|ttf|woff(?:2)?)$ {add_headerAccess-Control-Allow-Origin*;}# Do not save logs for these
location=/favicon.ico{auth_basicoff;allowall;log_not_foundoff;access_logoff;}location=/robots.txt{auth_basicoff;allowall;log_not_foundoff;access_logoff;}# Images
rewrite^/([0-9])(-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+.jpg$ /img/p/$1/$1$2$3.jpglast;rewrite^/([0-9])([0-9])(-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+.jpg$ /img/p/$1/$2/$1$2$3$4.jpglast;rewrite^/([0-9])([0-9])([0-9])(-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+.jpg$ /img/p/$1/$2/$3/$1$2$3$4$5.jpglast;rewrite^/([0-9])([0-9])([0-9])([0-9])(-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+.jpg$ /img/p/$1/$2/$3/$4/$1$2$3$4$5$6.jpglast;rewrite^/([0-9])([0-9])([0-9])([0-9])([0-9])(-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+.jpg$ /img/p/$1/$2/$3/$4/$5/$1$2$3$4$5$6$7.jpglast;rewrite^/([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+.jpg$ /img/p/$1/$2/$3/$4/$5/$6/$1$2$3$4$5$6$7$8.jpglast;rewrite^/([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+.jpg$ /img/p/$1/$2/$3/$4/$5/$6/$7/$1$2$3$4$5$6$7$8$9.jpglast;rewrite^/([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+.jpg$ /img/p/$1/$2/$3/$4/$5/$6/$7/$8/$1$2$3$4$5$6$7$8$9$10.jpglast;rewrite^/c/([0-9]+)(-[.*_a-zA-Z0-9-]*)(-[0-9]+)?/.+.jpg$ /img/c/$1$2$3.jpglast;rewrite^/c/([a-zA-Z_-]+)(-[0-9]+)?/.+.jpg$ /img/c/$1$2.jpglast;# AlphaImageLoader for IE and fancybox
rewrite^images_ie/?([^/]+)\.(jpe?g|png|gif)$ js/jquery/plugins/fancybox/images/$1.$2last;# Web service API
rewrite^/api/?(.*)$ /webservice/dispatcher.php?url=$1last;# Installation sandbox
rewrite^(/install(?:-dev)?/sandbox)/(.*)/$1/test.phplast;#Change this block to your admin folder
location/admin_CHANGE_ME{if(!-e$request_filename){rewrite^/.*$ /admin_CHANGE_ME/index.phplast;}}# File security
# .htaccess .DS_Store .htpasswd etc
location~/\.{denyall;}# Source code directories
location~^/(app|bin|cache|classes|config|controllers|docs|localization|override|src|tests|tools|translations|travis-scripts|vendor|var)/{denyall;}# Prevent exposing other sensitive files
location~\.(yml|log|tpl|twig|sass)${denyall;}# Prevent injection of php files
location/upload{location~\.php${denyall;}}location/img{location~\.php${denyall;}}# PHP FPM part
location~\.php${includesnippets/fastcgi-php.conf;fastcgi_passunix:/run/php/php7.2-fpm.sock;}}