nginx.conf 980 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. server {
  2. listen 80 default_server;
  3. root /var/www/yourdomain.ltd/public_html;
  4. index index.html index.php;
  5. server_name yourdomain.ltd;
  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 on;
  13. # error_log /var/log/nginx/error.log error;
  14. error_log /var/www/yourdomain.ltd/log/error.log;
  15. sendfile off;
  16. client_max_body_size 100m;
  17. location ~ \.php$ {
  18. fastcgi_split_path_info ^(.+\.php)(/.+)$;
  19. fastcgi_pass unix:/run/php/php7.0-fpm.sock
  20. fastcgi_index index.php;
  21. include fastcgi_params;
  22. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  23. fastcgi_intercept_errors off;
  24. fastcgi_buffer_size 16k;
  25. fastcgi_buffers 4 16k;
  26. }
  27. location ~ /\.ht {
  28. deny all;
  29. }
  30. }