Nginnxで簡単にDruplalをオープンし、簡単にリンクします。

2169 ワード

Drupalはapacheの環境下で簡潔なリンクを使うのが楽だということはよく知られています。公式で作成されたhttaccessファイルはソースコードに添付されていますので、配置の中で直接開けられます。しかし、Nginnxの下ではそんなに簡単ではないですが、心配しないでください。簡単に言えば、実は短いコードを付ければいいです。原理を理解する必要はありません。
NFgixオープン方法
あなたのnginxプロファイルに追加(赤い部分):
server
{

    listen       80;
    server_name mentry.cn; #server_name end
    index index.html index.htm index.php; #index end

    root  /home/wwwroot/mentry.cn/web$subdomain;

     location / {
            try_files   $uri $uri/ /index.php; }
実践例
もし私のウェブサイトがバーチャルホスト技術を使ったら、バーチャルホスト設定ファイルに直接追加すればいいです。たとえば私はAMH 4.0セット(LNMP)を使用していますが、/usr/local/nginx/conf/vhost/の下には「mentry.net.co nf」のような仮想ホストプロファイルがあります。開けたら、赤いコードを追加すればいいです。
server{    listen      80;    server.uname mentry.net;落server.uname end    index index.index.httm index.php;燃index end
    set$subdomain';    root /ホーム/wroot/menntry.net/web/subdomann;    include rewrite/amh.com nf;菗rewrite end
    #error uage        erroruage 400/Error Pages/400.        erroruage 403/Error Pages/403.        error uage 404/Error Pages/40.4.        error uage 502/Error Pages/502.        location~/Errer Pages/(400|401𞓜403|404𞓜502|503)\.html     {                root/home/wroot/menry.cn/web        }
    location~.*.php$    {        fastcgitap ass unix:/tmp/php-cgi-mentry.cn.sock;        fastcgiguindex index.php;        include fcgi-host.com nf;        fastcgi uparam DOCUMENTUROOT /ウェブ$subdoman;        fastcgigauparam SCRIPT_FILENAME /web$subdomann$fastcgicauscriptmen;    }
    location~.*.(gif𞓜jpg𞓜jpeg|pg𞓜bmp𞓜bmp𞓜swf𞓜fv|mp 3|wma)$    {        expires     30 d;    }
    location~.*.(js 124; css)$    {        expires     12 h;    }
    access logoff;璢access logend    errorgg/dev/null;沝errorg end         location/{            tryfiles  $uri/uri/index.php;        }}