nginx.conf 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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. }
  24. server {
  25. listen 8080;
  26. server_name localhost;
  27. root /home/tfb/FrameworkBenchmarks/php-yii2/app;
  28. index index.php;
  29. location / {
  30. try_files $uri $uri/ /index.php?$args;
  31. }
  32. # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
  33. #
  34. location ~ \.php$ {
  35. fastcgi_split_path_info ^(.+\.php)(.*)$;
  36. fastcgi_pass fastcgi_backend;
  37. set $fsn /index.php;
  38. if (-f $document_root$fastcgi_script_name){
  39. set $fsn $fastcgi_script_name;
  40. }
  41. fastcgi_param SCRIPT_FILENAME $document_root$fsn;
  42. #PATH_INFO and PATH_TRANSLATED can be omitted, but RFC 3875 specifies them for CGI
  43. fastcgi_param PATH_INFO $fastcgi_path_info;
  44. fastcgi_param PATH_TRANSLATED $document_root$fsn;
  45. include /usr/local/nginx/conf/fastcgi_params;
  46. }
  47. }
  48. }