simple-phpfpm.nginxconf 972 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. server {
  2. listen 80;
  3. listen [::]:80;
  4. server_name DOMAIN.LTD;
  5. root /var/www/DOMAIN.LTD/public_html;
  6. index index.html index.php;
  7. charset utf-8;
  8. location / {
  9. try_files $uri $uri/ /index.php?$query_string;
  10. }
  11. location = /favicon.ico { access_log off; log_not_found off; }
  12. location = /robots.txt { access_log off; log_not_found off; }
  13. access_log on;
  14. error_log /var/www/DOMAIN.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.4-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. # website should not be displayed inside a <frame>, an <iframe> or an <object>
  31. add_header X-Frame-Options SAMEORIGIN;
  32. }