Advertisement
Guest User

basic nginx config

a guest
Feb 21st, 2012
810
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.03 KB | None | 0 0
  1. upstream php_backend
  2. {
  3. # server unix:/tmp/php-cgi.socket;
  4. server 127.0.0.1:9000;
  5. server 127.0.0.1:9000;
  6. }
  7.  
  8. server
  9. {
  10. listen 80;
  11. server_name localhost;
  12.  
  13. charset utf-8;
  14. index index.php index.html;
  15. root /home/avalak/localhost;
  16.  
  17. location /
  18. {
  19. try_files $uri $uri/ @php;
  20. }
  21.  
  22. ## PHP5-FPM handler
  23. location ~ .php$
  24. {
  25. ## NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini
  26. fastcgi_pass php_backend;
  27. fastcgi_index index.php;
  28.  
  29. include fastcgi_params;
  30. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  31. }
  32.  
  33. location @php
  34. {
  35. ## NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini
  36. fastcgi_pass php_backend;
  37. fastcgi_index index.php;
  38.  
  39. include fastcgi_params;
  40. fastcgi_param SCRIPT_FILENAME $document_root/index.php;
  41. }
  42. location ~* \.(js|css|png|jpg|jpeg|gif|ico)$
  43. {
  44. expires max;
  45. log_not_found off;
  46. }
  47. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement