nginxの設定PHP環境をサポート

オープンnginxの設定ファイル

VIMなど/ nginxの/ nginx.confを入力します。

設定ファイルの拡張子を探します:

次のようにプロファイル設定環境を開きます。

サーバー{

    80を聞きます

    SERVER_NAME server.baishi360.cn ;

 

    #charset KOI8-R

    #access_log /var/log/nginx/host.access.logメイン

 

    位置/ {

        ルートは、/ usr / share / nginxの/ htmlの

        インデックスのindex.phpのindex.html index.htmを

    }

 

    #error_page 404 /404.html

 

    #静的ページ/50x.htmlにサーバーエラーページにリダイレクト

    #

    error_page 500 502 503 504 /50x.html

    位置= /50x.html {

        ルートは、/ usr / share / nginxの/ htmlの

    }

 

    #プロキシ127.0.0.1:80にリスニングのApacheにPHPスクリプト

    #

    #location〜\ phpの$ {

    #proxy_pass http://127.0.0.1

    #}

 

    #127.0.0.1:9000にリスニングのFastCGIサーバにPHPスクリプトを渡します

    #

    場所〜\ phpの$ {

        ルートHTML ;

        fastcgi_pass 127.0.0.1:9000

        fastcgi_indexのindex.phpを

        fastcgi_param SCRIPT_FILENAME $ DOCUMENT_ROOT $ fastcgi_script_name

 

        ヒント:「好きではないファイルの変更に絶対パスを」:

        fastcgi_paramのSCRIPT_FILENAMEを/ usr / share / nginxの/ htmlの$ fastcgi_script_name

 

        fastcgi_paramsが含まれます

    }

 

    #.htaccessファイルへのアクセスを拒否し、Apacheのドキュメントルート場合には、

    #は、nginxのの1に同意します

    #

    #location〜/\.ht {

    #すべてを否定します

    #}

}

 

おすすめ

転載: www.cnblogs.com/it1000/p/11088096.html