Advertisement
Guest User

Untitled

a guest
Mar 18th, 2012
19
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.84 KB | None | 0 0
  1. server {
  2. listen 80;
  3. server_name chive.local;
  4.  
  5. ## Parameterization using hostname of access and log filenames.
  6. access_log /home/www/chive.local/log/access.log;
  7. error_log /home/www/chive.local/log/error.log;
  8.  
  9. root /home/www/chive.local/htdocs;
  10. index index.php index.html;
  11.  
  12. ## Support for favicon. Return a 204 (No Content) if the favicon
  13. ## doesn't exist.
  14. location = /favicon.ico {
  15. try_files /favicon.ico =204;
  16. }
  17.  
  18. location / {
  19.  
  20. location ~ ^(?<script>.+\.php)(?<path_info>.*)$ {
  21. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  22. include fastcgi_params;
  23. fastcgi_buffers 256 4k;
  24. fastcgi_intercept_errors on;
  25. fastcgi_read_timeout 14400;
  26. fastcgi_index index.php;
  27. fastcgi_param SCRIPT_FILENAME $document_root$script;
  28. fastcgi_param SCRIPT_NAME $script;
  29. fastcgi_param PATH_INFO $path_info;
  30.  
  31. fastcgi_pass backend;
  32. }
  33.  
  34. location /protected {
  35. internal;
  36. }
  37.  
  38. location /yii {
  39. internal;
  40. }
  41.  
  42. location ~* .+\.(?:css|gif|htc|js|jpe?g|png|swf)$ {
  43. expires max;
  44. ## No need to bleed constant updates. Send the all shebang in one
  45. ## fell swoop.
  46. tcp_nodelay off;
  47. ## Set the OS file cache.
  48. open_file_cache max=100 inactive=120s;
  49. open_file_cache_valid 45s;
  50. open_file_cache_min_uses 2;
  51. open_file_cache_errors off;
  52. }
  53. }
  54.  
  55. ## We need to capture the case where the index.php is missing,
  56. ## hence we drop out of the path info thingie.
  57. location ~* /([^\.])$ {
  58. return 302 /index.php/$1;
  59. }
  60.  
  61. ## Close up git repo access.
  62. location ^~ /.git {
  63. return 404;
  64. }
  65.  
  66. } # server
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement