Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- server {
- listen 80;
- set $host_path "/var/www/vhosts/app";
- server_name domain.int.com;
- access_log /var/www/vhosts/app/logs/access.log;
- error_log /var/www/vhosts/app/logs/error.log error;
- root $host_path/htdocs;
- set $yii_bootstrap "index.php";
- charset utf-8;
- location / {
- index index.html $yii_bootstrap;
- try_files $uri $uri/ /$yii_bootstrap?$args;
- }
- location ~ ^/(protected|framework|themes/\w+/views) {
- deny all;
- }
- #avoid processing of calls to unexisting static files by yii
- location ~ \.(js|css|png|jpg|gif|swf|ico|pdf|mov|fla|zip|rar)$ {
- try_files $uri =404;
- }
- location ~ \.php$ {
- fastcgi_split_path_info ^(.+\.php)(.*)$;
- #let yii catch the calls to unexising PHP files
- set $fsn /$yii_bootstrap;
- if (-f $document_root$fastcgi_script_name){
- set $fsn $fastcgi_script_name;
- }
- #
- root $host_path/htdocs;
- fastcgi_pass unix:/opt/app/php5/var/run/php-fpm.sock;
- fastcgi_index index.php;
- #
- fastcgi_param SCRIPT_FILENAME $document_root$fsn;
- include fastcgi_params;
- fastcgi_param PATH_INFO $fastcgi_path_info;
- fastcgi_param PATH_TRANSLATED $document_root$fsn;
- }
- # prevent nginx from serving dotfiles (.htaccess, .svn, .git, etc.)
- location ~ /\. {
- deny all;
- access_log off;
- log_not_found off;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement