nginx.conf 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. #user nobody;
  2. worker_processes 8;
  3. #error_log logs/error.log;
  4. #error_log logs/error.log notice;
  5. #error_log logs/error.log info;
  6. error_log stderr error;
  7. #pid logs/nginx.pid;
  8. events {
  9. worker_connections 1024;
  10. }
  11. http {
  12. include /usr/local/nginx/conf/mime.types;
  13. default_type application/octet-stream;
  14. #access_log logs/access.log main;
  15. access_log off;
  16. sendfile on;
  17. #tcp_nopush on;
  18. #keepalive_timeout 0;
  19. keepalive_timeout 65;
  20. #gzip on;
  21. upstream fastcgi_backend {
  22. server 127.0.0.1:9001;
  23. keepalive 32;
  24. }
  25. server {
  26. listen 8080;
  27. server_name localhost;
  28. root /home/tfb/FrameworkBenchmarks/php-yii2/app;
  29. index index.php;
  30. location / {
  31. try_files $uri $uri/ /index.php?$args;
  32. }
  33. # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
  34. #
  35. location ~ \.php$ {
  36. fastcgi_split_path_info ^(.+\.php)(.*)$;
  37. fastcgi_pass fastcgi_backend;
  38. fastcgi_keep_conn on;
  39. set $fsn /index.php;
  40. if (-f $document_root$fastcgi_script_name){
  41. set $fsn $fastcgi_script_name;
  42. }
  43. fastcgi_param SCRIPT_FILENAME $document_root$fsn;
  44. #PATH_INFO and PATH_TRANSLATED can be omitted, but RFC 3875 specifies them for CGI
  45. fastcgi_param PATH_INFO $fastcgi_path_info;
  46. fastcgi_param PATH_TRANSLATED $document_root$fsn;
  47. include /usr/local/nginx/conf/fastcgi_params;
  48. }
  49. }
  50. }