TEXT   26

nginx.conf

Guest on 23rd April 2022 12:45:00 AM

  1. ### Abantecart Settings ###
  2.     location = /favicon.ico {
  3.         log_not_found off;
  4.         access_log off;
  5.     }
  6.     location = /robots.txt {
  7.         allow all;
  8.         log_not_found off;
  9.         access_log off;
  10.     }
  11.     # Make sure files with the following extensions do not get loaded by nginx because nginx would
  12.     # display the source code, and these files can contain PASSWORDS!
  13.     location ~* \.(engine|inc|info|install|make|module|profile|test|po|sh|.*sql|theme|tpl(\.php)?|xtmpl)$|^(\..*|Entries.*|Repository|Root|Tag|Template)$|\.php_ {
  14.         deny all;
  15.     }
  16.     # Deny all attempts to access hidden files such as .htaccess, .htpasswd, .DS_Store (Mac).
  17.     location ~ /\. {
  18.         deny all;
  19.         access_log off;
  20.         log_not_found off;
  21.     }
  22.     ### Retina images handler. Check cookie and looking for file with @2x at the end of name
  23.     location ~* ^(.*)\.(jpg|jpeg|png|gif)$ {
  24.         set $hidpi_uri $1@2x.png;
  25.         if ($http_cookie !~ 'HTTP_IS_RETINA=1') {
  26.           break;
  27.         }
  28.         try_files $hidpi_uri $uri =404;
  29.     }
  30.  
  31.     location ~*  \.(jpg|jpeg|png|gif|css|js|ico)$ {
  32.         expires max;
  33.         log_not_found off;
  34.     }
  35.     location ~ /(system/logs|resources/download) {
  36.       deny all;
  37.       return 403;
  38.     }
  39.     location /admin/ {
  40.         location ~ .*\.(php)?$ {
  41.           deny all;
  42.           return 403;
  43.         }
  44.     }
  45.     #rewrite for images for retina-displays
  46.     location ~ / {
  47.         if (!-e $request_filename){
  48.             rewrite ^/(.*)\?*$ /index.php?_route_=$1 last;
  49.         }
  50.     }
  51.  
  52.  
  53. ### End of AbanteCart settings ###

Raw Paste


Login or Register to edit or fork this paste. It's free.