server { listen 80; server_name _; root /var/www/html; index index.php; client_max_body_size 128m; location ~ ^/app/(?:data|cache|plugins|optional)(?:/|$) { deny all; } location ~ ^/app/.*\.php$ { deny all; } location ~ /\.(?!well-known) { deny all; } location ^~ /app/avatars/ { try_files $uri =404; expires 30d; add_header Cache-Control "public, max-age=2592000, immutable"; add_header X-Content-Type-Options "nosniff"; access_log off; } location ~ ^/app/assets/(?:index\.(?:css|js|svg)|plugins\.(?:css|js))$ { try_files $uri =404; expires 1y; add_header Cache-Control "public, max-age=31536000, immutable"; add_header X-Content-Type-Options "nosniff"; access_log off; } location ~ ^/app/upload/.+\.attach$ { return 404; } location ~ ^/app/upload/.*\.(php|phtml|phar|cgi|pl)$ { return 404; } location /app/upload/ { try_files $uri =404; add_header X-Content-Type-Options "nosniff"; } location / { try_files $uri $uri/ /index.php?$query_string; } location ~ \.php$ { try_files $uri =404; include fastcgi_params; fastcgi_pass php:9000; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; } }