2016-04-17 9 views
0

私のWebルートは/ web/html/pubです。 $ MAGE_ROOT =/web/htmlNginx fastcgi取得404が見つかりません

ここにはnginx confのサンプルがあります。

root $MAGE_ROOT/pub; 
index index.php; 
autoindex off; 
charset off; 
location /pub { 
    root $MAGE_ROOT; 

    location ~ ^/pub/media/(downloadable|customer|import|theme_customization/.*\.xml) { 
     deny all; 
    } 

    add_header X-Frame-Options "SAMEORIGIN"; 
} 
location ~ (index|info|get|static|report|404|503)\.php$ { 
    try_files $uri =404; 
    fastcgi_pass fastcgi_backend; 
    fastcgi_index index.php; 
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; 
    include  fastcgi_params; 
} 

ここに私のデバッグエラーログがあります。私の人生のために

2016/04/17 20:58:24 [debug] 4856#6680: *1 http script var: "html/magento202" 
2016/04/17 20:58:24 [debug] 4856#6680: *1 open index "c:\web\nginx/html/magento202/pub/index.php" 
2016/04/17 20:58:24 [debug] 4856#6680: *1 internal redirect: "/pub/index.php?" 
2016/04/17 20:58:24 [debug] 4856#6680: *1 rewrite phase: 1 
2016/04/17 20:58:24 [debug] 4856#6680: *1 http script value: "html/magento202" 
2016/04/17 20:58:24 [debug] 4856#6680: *1 http script set $mage_root 
2016/04/17 20:58:24 [debug] 4856#6680: *1 http script value: "developer" 
2016/04/17 20:58:24 [debug] 4856#6680: *1 http script set $mage_mode 
2016/04/17 20:58:24 [debug] 4856#6680: *1 test location: "/" 
2016/04/17 20:58:24 [debug] 4856#6680: *1 test location: "setup" 
2016/04/17 20:58:24 [debug] 4856#6680: *1 test location: "pub" 
2016/04/17 20:58:24 [debug] 4856#6680: *1 test location: ~ "^/pub/media/(downloadable|customer|import|theme_customization/.*\.xml)" 
2016/04/17 20:58:24 [debug] 4856#6680: *1 test location: ~ "(index|info|get|static|report|404|503)\.php$" 
2016/04/17 20:58:24 [debug] 4856#6680: *1 using configuration "(index|info|get|static|report|404|503)\.php$" 
2016/04/17 20:58:24 [debug] 4856#6680: *1 http cl:-1 max:1048576 
2016/04/17 20:58:24 [debug] 4856#6680: *1 rewrite phase: 3 
2016/04/17 20:58:24 [debug] 4856#6680: *1 post rewrite phase: 4 
2016/04/17 20:58:24 [debug] 4856#6680: *1 generic phase: 5 
2016/04/17 20:58:24 [debug] 4856#6680: *1 generic phase: 6 
2016/04/17 20:58:24 [debug] 4856#6680: *1 generic phase: 7 
2016/04/17 20:58:24 [debug] 4856#6680: *1 access phase: 8 
2016/04/17 20:58:24 [debug] 4856#6680: *1 access phase: 9 
2016/04/17 20:58:24 [debug] 4856#6680: *1 access phase: 10 
2016/04/17 20:58:24 [debug] 4856#6680: *1 post access phase: 11 
2016/04/17 20:58:24 [debug] 4856#6680: *1 try files phase: 12 
2016/04/17 20:58:24 [debug] 4856#6680: *1 http script var: "html/magento202" 
2016/04/17 20:58:24 [debug] 4856#6680: *1 http script copy: "/pub" 
2016/04/17 20:58:24 [debug] 4856#6680: *1 http script var: "/pub/index.php" 
2016/04/17 20:58:24 [debug] 4856#6680: *1 trying to use file: "/pub/index.php" "c:\web\nginx/html/magento202/pub/pub/index.php" 
2016/04/17 20:58:24 [debug] 4856#6680: *1 trying to use file: "=404" "c:\web\nginx/html/magento202/pub=404" 
2016/04/17 20:58:24 [debug] 4856#6680: *1 http finalize request: 404, "/pub/index.php?" a:1, c:2 
2016/04/17 20:58:24 [debug] 4856#6680: *1 http special response: 404, "/pub/index.php?" 
2016/04/17 20:58:24 [debug] 4856#6680: *1 http set discard body 
2016/04/17 20:58:24 [debug] 4856#6680: *1 HTTP/1.1 404 Not Found 

私はhttp://domain/pub/に行くしようとすると、私は二回、URLになぜnginxの挿入「パブ」を把握することはできません。私は間違って何をしているすべてのアイデア?

答えて

0

あなたlocation /pub試みが継承されたindexディレクティブを適用することにより、URI /pub/を解決し、/pub/index.phpにURIを書き換えます。

.phpで終わるURIは、location ~ (index|info|get|static|report|404|503)\.php$ブロックで処理されます。このブロック内

は、(継承)ルートはURI製造に前置され、.../pubのように定義される:.../pub/pub/index.php

+0

私は疑いをこっそりことでした。正しいURIがcgiに渡されるようにphp catchブロックを修正する方法はありますか? –

関連する問題