admin.conf 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. server {
  2. # access_log /alidata/server/nginx/logs/default.log;
  3. error_log /alidata/server/nginx/logs/default_error.log;
  4. # access_log on
  5. # error_log off;
  6. listen 80;
  7. server_name localhost;
  8. root /alidata/www/;
  9. charset utf-8;
  10. location / {
  11. index index.html index.php;
  12. try_files $uri $uri/ /index.php?$args;
  13. }
  14. location ~ ^/(protected|framework|themes/\w+/views) {
  15. deny all;
  16. }
  17. #avoid processing of calls to unexisting static files by yii
  18. location ~ \.(js|css|png|jpg|gif|swf|ico|pdf|mov|fla|zip|rar)$ {
  19. expires 30d;
  20. try_files $uri =404;
  21. }
  22. # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
  23. #
  24. location ~ \.php {
  25. fastcgi_split_path_info ^(.+\.php)(.*)$;
  26. #let yii catch the calls to unexising PHP files
  27. set $fsn /index.php;
  28. if (-f $document_root$fastcgi_script_name){
  29. set $fsn $fastcgi_script_name;
  30. }
  31. fastcgi_pass 127.0.0.1:9000;
  32. fastcgi_index index.php;
  33. include fastcgi.conf;
  34. fastcgi_param SCRIPT_FILENAME $document_root$fsn;
  35. #PATH_INFO and PATH_TRANSLATED can be omitted, but RFC 3875 specifies them for CGI
  36. fastcgi_param PATH_INFO $fastcgi_path_info;
  37. fastcgi_param PATH_TRANSLATED $document_root$fsn;
  38. }
  39. # prevent nginx from serving dotfiles (.htaccess, .svn, .git, etc.)
  40. location ~ /\. {
  41. deny all;
  42. access_log off;
  43. log_not_found off;
  44. }
  45. }