Advertisement
Guest User

Untitled

a guest
Jul 22nd, 2017
54
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. server_name domain.tld www.domain.tld;
  3. root /var/www/wallabag/web;
  4.  
  5. location / {
  6. # try to serve file directly, fallback to app.php
  7. try_files $uri /app.php$is_args$args;
  8. }
  9. location ~ ^/app\.php(/|$) {
  10. # if, for some reason, you are still using PHP 5,
  11. # then replace /run/php/php7.0 by /var/run/php5
  12. fastcgi_pass unix:/run/php/php7.0-fpm.sock;
  13. fastcgi_split_path_info ^(.+\.php)(/.*)$;
  14. include fastcgi_params;
  15. # When you are using symlinks to link the document root to the
  16. # current version of your application, you should pass the real
  17. # application path instead of the path to the symlink to PHP
  18. # FPM.
  19. # Otherwise, PHP's OPcache may not properly detect changes to
  20. # your PHP files (see https://github.com/zendtech/ZendOptimizerPlus/issues/126
  21. # for more information).
  22. fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
  23. fastcgi_param DOCUMENT_ROOT $realpath_root;
  24. # Prevents URIs that include the front controller. This will 404:
  25. # http://domain.tld/app.php/some-path
  26. # Remove the internal directive to allow URIs like this
  27. internal;
  28. }
  29.  
  30. # return 404 for all other php files not matching the front controller
  31. # this prevents access to other php files you don't want to be accessible.
  32. location ~ \.php$ {
  33. return 404;
  34. }
  35.  
  36. error_log /var/log/nginx/wallabag_error.log;
  37. access_log /var/log/nginx/wallabag_access.log;
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement