Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # redirect index.php to root
- rewrite ^/index.php/(.*) /$1 permanent;
- # Deny everything else in /app folder except Assets folder in bundles
- location ~ /app/bundles/.*/Assets/ {
- allow all;
- access_log off;
- }
- # Deny everything else in /addons or /plugins folder except Assets folder in bundles
- location ~ /(addons|plugins)/.*/Assets/ {
- allow all;
- access_log off;
- }
- # Deny all php files in themes folder
- location ~* ^/themes/(.*)\.php {
- deny all;
- }
- # Deny yml, twig, markdown, init file access
- location ~* /(.*)\.(?:markdown|md|twig|yaml|yml|ht|htaccess|ini)$ {
- deny all;
- access_log off;
- log_not_found off;
- }
- # Deny all attempts to access hidden files/folders such as .htaccess, .htpasswd, .DS_Store (Mac), etc...
- location ~ /\. {
- deny all;
- access_log off;
- log_not_found off;
- }
- # Deny all grunt, composer files
- location ~* (Gruntfile|package|composer)\.(js|json)$ {
- deny all;
- access_log off;
- log_not_found off;
- }
- location ~* \.(jpg|jpeg|png|ico|pdf)$ {
- expires 15d;
- }
- # Deny access to any files with a .php extension in the uploads directory
- location ~* /(?:uploads|files)/.*\.php$ {
- deny all;
- }
- # Solve email tracking pixel not found
- location ~ email/(.*).gif {
- try_files $uri /index.php?$args;
- }
- # Solve JS Loading 404 Error
- location ~ (.*).js {
- try_files $uri /index.php?$args;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement