koichi

nginx.conf for Vanilla Forums

May 3rd, 2019
293
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Nginx 1.00 KB | None | 0 0
  1.     root /srv/vanilla;
  2.  
  3.     # Add index.php to the list if you are using PHP
  4.     index index.php;
  5.  
  6.     # Block some folders as an extra hardening measure.
  7.     location ~* "/\.git" { deny all; return 403; }
  8.     location ~* "^/build/" { deny all; return 403; }
  9.     location ~* "^/cache/" { deny all; return 403; }
  10.     location ~* "^/cgi-bin/" { deny all; return 403; }
  11.     location ~* "^/uploads/import/" { deny all; return 403; }
  12.     location ~* "^/conf/" { deny all; return 403; }
  13.     location ~* "^/tests/" { deny all; return 403; }
  14.     location ~* "^/vendor/" { deny all; return 403; }
  15.     location ^~ "/favicon.ico" { access_log off; log_not_found off; return 404; }
  16.  
  17.     # This handles all the main requests thru index.php.
  18.     location ~ \.php$ {
  19.         # send to fastcgi
  20.         include fastcgi.conf;
  21.         fastcgi_index index.php;
  22.         fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  23.         fastcgi_pass unix:/run/php/php7.3-fpm.sock;
  24.     }
  25.  
  26.     location / {
  27.         try_files $uri $uri/ /index.php$uri;
  28.     }
  29.  
  30.     location ~ /\.ht {
  31.         deny all;
  32.     }
Add Comment
Please, Sign In to add comment