Advertisement
Guest User

Untitled

a guest
Dec 11th, 2018
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.71 KB | None | 0 0
  1. server {
  2. listen 80;
  3. server_name _;
  4. root /var/www/html/chocobb/public;
  5.  
  6. location / {
  7. # try to serve file directly, fallback to index.php
  8. try_files $uri /index.php$is_args$args;
  9. }
  10.  
  11. location ~ ^/index\.php(/|$) {
  12. fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
  13. fastcgi_split_path_info ^(.+\.php)(/.*)$;
  14. include fastcgi_params;
  15.  
  16. # optionally set the value of the environment variables used in the application
  17. # fastcgi_param APP_ENV prod;
  18. # fastcgi_param APP_SECRET <app-secret-id>;
  19. # fastcgi_param DATABASE_URL "mysql://db_user:db_pass@host:3306/db_name";
  20.  
  21. # When you are using symlinks to link the document root to the
  22. # current version of your application, you should pass the real
  23. # application path instead of the path to the symlink to PHP
  24. # FPM.
  25. # Otherwise, PHP's OPcache may not properly detect changes to
  26. # your PHP files (see https://github.com/zendtech/ZendOptimizerPlus/issues/126
  27. # for more information).
  28. fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
  29. fastcgi_param DOCUMENT_ROOT $realpath_root;
  30. # Prevents URIs that include the front controller. This will 404:
  31. # http://domain.tld/index.php/some-path
  32. # Remove the internal directive to allow URIs like this
  33. internal;
  34. }
  35.  
  36. # return 404 for all other php files not matching the front controller
  37. # this prevents access to other php files you don't want to be accessible.
  38. location ~ \.php$ {
  39. return 404;
  40. }
  41.  
  42. error_log /var/log/nginx/project_error.log;
  43. access_log /var/log/nginx/project_access.log;
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement