You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

38 lines
1.0 KiB

8 months ago
  1. server {
  2. charset utf-8;
  3. client_max_body_size 128M;
  4. sendfile off;
  5. listen 80; ## listen for ipv4
  6. #listen [::]:80 default_server ipv6only=on; ## listen for ipv6
  7. server_name yii2basic.test;
  8. root /app/web/;
  9. index index.php;
  10. access_log /app/vagrant/nginx/log/yii2basic.access.log;
  11. error_log /app/vagrant/nginx/log/yii2basic.error.log;
  12. location / {
  13. # Redirect everything that isn't a real file to index.php
  14. try_files $uri $uri/ /index.php$is_args$args;
  15. }
  16. # uncomment to avoid processing of calls to non-existing static files by Yii
  17. #location ~ \.(js|css|png|jpg|gif|swf|ico|pdf|mov|fla|zip|rar)$ {
  18. # try_files $uri =404;
  19. #}
  20. #error_page 404 /404.html;
  21. location ~ \.php$ {
  22. include fastcgi_params;
  23. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  24. #fastcgi_pass 127.0.0.1:9000;
  25. fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
  26. try_files $uri =404;
  27. }
  28. location ~ /\.(ht|svn|git) {
  29. deny all;
  30. }
  31. }