nginx.conf 1.4 KB

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