grav.conf 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. index index.html index.php;
  2. ## Begin - Server Info
  3. root /jails/grav/usr/local/www/grav;
  4. server_name localhost;
  5. ## End - Server Info
  6. ## Begin - Index
  7. # for subfolders, simply adjust:
  8. # `location /subfolder {`
  9. # and the rewrite to use `/subfolder/index.php`
  10. location / {
  11. try_files $uri $uri/ /index.php?$query_string;
  12. }
  13. ## End - Index
  14. ## Begin - Security
  15. # deny all direct access for these folders
  16. location ~* /(\.git|cache|bin|logs|backup|tests)/.*$ { return 403; }
  17. # deny running scripts inside core system folders
  18. location ~* /(system|vendor)/.*\.(txt|xml|md|html|htm|shtml|shtm|json|yaml|yml|php|php2|php3|php4|php5|phar|phtml|pl|py|cgi|twig|sh|bat)$ { return 403; }
  19. # deny running scripts inside user folder
  20. location ~* /user/.*\.(txt|md|json|yaml|yml|php|php2|php3|php4|php5|phar|phtml|pl|py|cgi|twig|sh|bat)$ { return 403; }
  21. # deny access to specific files in the root folder
  22. location ~ /(LICENSE\.txt|composer\.lock|composer\.json|nginx\.conf|web\.config|htaccess\.txt|\.htaccess) { return 403; }
  23. ## End - Security
  24. ## Begin - PHP
  25. location ~ \.php$ {
  26. # Choose either a socket or TCP/IP address
  27. fastcgi_pass unix:/jails/grav/var/run/php-fpm.sock;
  28. # fastcgi_pass unix:/var/run/php5-fpm.sock; #legacy
  29. # fastcgi_pass 127.0.0.1:9000;
  30. fastcgi_split_path_info ^(.+\.php)(/.+)$;
  31. fastcgi_index index.php;
  32. include fastcgi_params;
  33. fastcgi_param SCRIPT_FILENAME /usr/local/www/grav/$fastcgi_script_name;
  34. }
  35. location ~ /forge {
  36. rewrite ^ https://forge.dmarec.fr redirect;
  37. }
  38. ## End - PHP