nginx.conf 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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/ubuntu/FrameworkBenchmarks/php-yii2;
  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 /$yii_bootstrap;
  40. if (-f $document_root$fastcgi_script_name){
  41. set $fsn $fastcgi_script_name;
  42. }
  43. include fastcgi_params;
  44. fastcgi_param SCRIPT_FILENAME $document_root$fsn;
  45. #PATH_INFO and PATH_TRANSLATED can be omitted, but RFC 3875 specifies them for CGI
  46. fastcgi_param PATH_INFO $fastcgi_path_info;
  47. fastcgi_param PATH_TRANSLATED $document_root$fsn;
  48. include /usr/local/nginx/conf/fastcgi_params;
  49. }
  50. }
  51. }