Advertisement
Guest User

Untitled

a guest
Feb 25th, 2014
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.78 KB | None | 0 0
  1. server {
  2. listen 80;
  3.  
  4. set $host_path "/var/www/vhosts/app";
  5. server_name domain.int.com;
  6.  
  7. access_log /var/www/vhosts/app/logs/access.log;
  8. error_log /var/www/vhosts/app/logs/error.log error;
  9.  
  10. root $host_path/htdocs;
  11. set $yii_bootstrap "index.php";
  12.  
  13. charset utf-8;
  14.  
  15. location / {
  16. index index.html $yii_bootstrap;
  17. try_files $uri $uri/ /$yii_bootstrap?$args;
  18. }
  19.  
  20. location ~ ^/(protected|framework|themes/\w+/views) {
  21. deny all;
  22. }
  23.  
  24. #avoid processing of calls to unexisting static files by yii
  25. location ~ \.(js|css|png|jpg|gif|swf|ico|pdf|mov|fla|zip|rar)$ {
  26. try_files $uri =404;
  27. }
  28.  
  29. location ~ \.php$ {
  30.  
  31. fastcgi_split_path_info ^(.+\.php)(.*)$;
  32.  
  33. #let yii catch the calls to unexising PHP files
  34. set $fsn /$yii_bootstrap;
  35. if (-f $document_root$fastcgi_script_name){
  36. set $fsn $fastcgi_script_name;
  37. }
  38.  
  39. #
  40. root $host_path/htdocs;
  41. fastcgi_pass unix:/opt/app/php5/var/run/php-fpm.sock;
  42. fastcgi_index index.php;
  43.  
  44. #
  45. fastcgi_param SCRIPT_FILENAME $document_root$fsn;
  46. include fastcgi_params;
  47. fastcgi_param PATH_INFO $fastcgi_path_info;
  48. fastcgi_param PATH_TRANSLATED $document_root$fsn;
  49. }
  50.  
  51.  
  52. # prevent nginx from serving dotfiles (.htaccess, .svn, .git, etc.)
  53. location ~ /\. {
  54. deny all;
  55. access_log off;
  56. log_not_found off;
  57. }
  58.  
  59. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement