nginx.conf 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. worker_processes 8;
  2. error_log stderr error;
  3. events {
  4. worker_connections 1024;
  5. }
  6. http {
  7. include /usr/local/nginx/conf/mime.types;
  8. default_type application/octet-stream;
  9. sendfile on;
  10. keepalive_timeout 65;
  11. access_log off;
  12. upstream fastcgi_backend {
  13. server 127.0.0.1:9001;
  14. keepalive 32;
  15. }
  16. server {
  17. listen 8080;
  18. server_name localhost;
  19. root /home/ubuntu/FrameworkBenchmarks/php-yaf/public/;
  20. index index.php;
  21. location / {
  22. try_files $uri /index.php?$args;
  23. if (-f $request_filename) {
  24. expires max;
  25. break;
  26. }
  27. }
  28. location ~ \.php$ {
  29. try_files $uri =404;
  30. fastcgi_pass fastcgi_backend;
  31. fastcgi_keep_conn on;
  32. fastcgi_index index.php;
  33. include /usr/local/nginx/conf/fastcgi_params;
  34. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  35. }
  36. }
  37. }