0

私はNginXの恋人です。php - YII フレームワークでの作業。そして、ローカルPCでそのように構成しました

server {
    set $host_path "/var/www/domain";

    server_name domain.local;
    root $host_path;
    set $yii_bootstrap "index.php";

    charset utf-8;

    location /backend {
        index  index.html $yii_bootstrap;
        try_files $uri $uri/ /$yii_bootstrap?$args;
    }

    location / {
        index  index.html $yii_bootstrap;
        try_files $uri $uri/ /$yii_bootstrap?$args;
    }

    location ~ ^/(protected|framework|themes/\w+/views) {
        deny  all;
    }


    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;
        }
        fastcgi_pass unix:/var/run/php5-fpm.sock;
        fastcgi_index index.php;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        include fastcgi_params;
      }


    # prevent nginx from serving dotfiles (.htaccess, .svn, .git, etc.)
    location ~ /\. {
        deny all;
        access_log off;
        log_not_found off;
    }
}

プロジェクトを共有 Web サーバーにアップロードする必要があります。Apache の設定に詳しい方: .htaccess に翻訳していただけますか? 事前にThx

4

0 に答える 0