Guest User

Untitled

a guest
Sep 26th, 2016
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.55 KB | None | 0 0
  1. server {
  2. listen 80;
  3. server_name drupal8.loc;
  4. root /Users/ApacheEx/WEB/drupal8;
  5.  
  6. include /usr/local/etc/nginx/conf.d/php-fpm;
  7.  
  8. location = /favicon.ico {
  9. log_not_found off;
  10. access_log off;
  11. }
  12.  
  13. location = /robots.txt {
  14. allow all;
  15. log_not_found off;
  16. access_log off;
  17. }
  18.  
  19. # Very rarely should these ever be accessed outside of your lan
  20. location ~* \.(txt|log)$ {
  21. allow 127.0.0.1;
  22. deny all;
  23. }
  24.  
  25. location ~ \..*/.*\.php$ {
  26. return 403;
  27. }
  28.  
  29. location ~ ^/sites/.*/private/ {
  30. return 403;
  31. }
  32.  
  33. # Allow "Well-Known URIs" as per RFC 5785
  34. location ~* ^/.well-known/ {
  35. allow all;
  36. }
  37.  
  38. # Block access to "hidden" files and directories whose names begin with a
  39. # period. This includes directories used by version control systems such
  40. # as Subversion or Git to store control files.
  41. location ~ (^|/)\. {
  42. return 403;
  43. }
  44.  
  45. location / {
  46. try_files $uri @rewrite;
  47. }
  48.  
  49. location @rewrite {
  50. rewrite ^ /index.php;
  51. }
  52.  
  53. # Don't allow direct access to PHP files in the vendor directory.
  54. location ~ /vendor/.*\.php$ {
  55. deny all;
  56. return 404;
  57. }
  58.  
  59. location ~ ^/sites/.*/files/imagecache/ {
  60. try_files $uri @rewrite;
  61. }
  62.  
  63. location ~ ^/sites/.*/files/styles/ {
  64. try_files $uri @rewrite;
  65. }
  66.  
  67. location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
  68. expires max;
  69. log_not_found off;
  70. }
  71. }
Add Comment
Please, Sign In to add comment