nginx_site_conf.tpl 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. server {
  2. listen 80;
  3. server_name {{domains}};
  4. root "{{project_dir}}/public";
  5. index index.html index.htm index.php;
  6. charset utf-8;
  7. location / {
  8. try_files $uri $uri/ /index.php?$query_string;
  9. }
  10. location = /favicon.ico { access_log off; log_not_found off; }
  11. location = /robots.txt { access_log off; log_not_found off; }
  12. access_log /var/log/nginx/{{project}}.log;
  13. error_log /var/log/nginx/{{project}}-error.log error;
  14. sendfile off;
  15. client_max_body_size 100m;
  16. location ~ \.php$ {
  17. fastcgi_split_path_info ^(.+\.php)(/.+)$;
  18. fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
  19. fastcgi_index index.php;
  20. include fastcgi_params;
  21. fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
  22. fastcgi_param DOCUMENT_ROOT $realpath_root;
  23. fastcgi_intercept_errors off;
  24. fastcgi_buffer_size 16k;
  25. fastcgi_buffers 4 16k;
  26. fastcgi_connect_timeout 300;
  27. fastcgi_send_timeout 300;
  28. fastcgi_read_timeout 300;
  29. }
  30. location ~ /\.ht {
  31. deny all;
  32. }
  33. }