nginx-fpm.conf 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. user www-data;
  2. worker_processes auto;
  3. error_log stderr error;
  4. #worker_rlimit_nofile 200000;
  5. events {
  6. worker_connections 16384;
  7. }
  8. http {
  9. include /etc/nginx/mime.types;
  10. default_type application/octet-stream;
  11. access_log off;
  12. server_tokens off;
  13. sendfile on;
  14. tcp_nopush on;
  15. tcp_nodelay on;
  16. keepalive_timeout 65;
  17. keepalive_disable none;
  18. keepalive_requests 10000;
  19. #the bench don't use any static file
  20. #open_file_cache max=2000 inactive=20s;
  21. #open_file_cache_valid 60s;
  22. #open_file_cache_min_uses 5;
  23. #open_file_cache_errors off;
  24. #FastCGI optimizations
  25. fastcgi_buffers 256 16k;
  26. fastcgi_buffer_size 128k;
  27. fastcgi_connect_timeout 30s;
  28. fastcgi_send_timeout 60s;
  29. fastcgi_read_timeout 60s;
  30. fastcgi_busy_buffers_size 256k;
  31. fastcgi_temp_file_write_size 256k;
  32. reset_timedout_connection on;
  33. server_names_hash_bucket_size 100;
  34. upstream fastcgi_backend {
  35. server unix:/var/run/php/php7.4-fpm.sock;
  36. keepalive 40;
  37. }
  38. server {
  39. listen 8080;
  40. server_name localhost;
  41. root /codeigniter/;
  42. index index.php;
  43. location / {
  44. try_files $uri /index.php?$uri&$args;
  45. }
  46. location = /index.php {
  47. fastcgi_pass fastcgi_backend;
  48. fastcgi_keep_conn on;
  49. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  50. include /etc/nginx/fastcgi_params;
  51. }
  52. }
  53. }