nginx-fpm.conf 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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. keepalive_timeout 65;
  15. upstream fastcgi_backend {
  16. server unix:/var/run/php/php7.3-fpm.sock;
  17. keepalive 50;
  18. }
  19. server {
  20. listen 8080;
  21. server_name localhost;
  22. root /yii2/app;
  23. index index.php;
  24. location / {
  25. try_files $uri $uri/ /index.php?$args;
  26. }
  27. location ~ \.php$ {
  28. fastcgi_split_path_info ^(.+\.php)(.*)$;
  29. fastcgi_pass fastcgi_backend;
  30. fastcgi_keep_conn on;
  31. set $fsn /index.php;
  32. if (-f $document_root$fastcgi_script_name){
  33. set $fsn $fastcgi_script_name;
  34. }
  35. fastcgi_param SCRIPT_FILENAME $document_root$fsn;
  36. fastcgi_param PATH_INFO $fastcgi_path_info;
  37. fastcgi_param PATH_TRANSLATED $document_root$fsn;
  38. include /etc/nginx/fastcgi_params;
  39. }
  40. }
  41. }