nginx.conf 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. user www-data;
  2. worker_processes auto;
  3. error_log stderr error;
  4. events {
  5. worker_connections 16384;
  6. multi_accept on;
  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. open_file_cache max=2000 inactive=20s;
  18. open_file_cache_valid 60s;
  19. open_file_cache_min_uses 5;
  20. open_file_cache_errors off;
  21. #FastCGI optimizations
  22. fastcgi_buffers 256 16k;
  23. fastcgi_buffer_size 128k;
  24. fastcgi_connect_timeout 30s;
  25. fastcgi_send_timeout 60s;
  26. fastcgi_read_timeout 60s;
  27. fastcgi_busy_buffers_size 256k;
  28. fastcgi_temp_file_write_size 256k;
  29. reset_timedout_connection on;
  30. server_names_hash_bucket_size 100;
  31. upstream fastcgi_backend {
  32. server unix:/var/run/php/php7.2-fpm.sock;
  33. keepalive 50;
  34. }
  35. server {
  36. listen 8080;
  37. server_name localhost;
  38. root /symfony/public/;
  39. index index.php;
  40. location / {
  41. try_files $uri $uri/ /index.php?$uri&$args;
  42. }
  43. location ~ \.php$ {
  44. fastcgi_pass fastcgi_backend;
  45. fastcgi_keep_conn on;
  46. fastcgi_index index.php;
  47. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  48. include /etc/nginx/fastcgi_params;
  49. }
  50. }
  51. }