2016-04-07 7 views
0

私が達成しようとしているのは、誰かが私の家/インデックスページを訪問したときに、私はindex.htmlファイルをサーバーする必要があります。しかし、別のURL /パスであれば、私のindex.phpファイルにリクエストを渡します(私はSymfonyを使用しています)。どのように私のホームページとHTMLファイルと他のすべてのパス/ URLをPHPファイルでサーバにする

私はthis exampleに従っていますが、動作していません。常にPHPファイルを提供しています。

server 
{ 
    listen  80; 
    server_name mysite.com; 

    root /path/to/my/web; 
    index index.html index.php; 

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

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

} 

私と共有できるヘルプやガイダンスはありがたいです。

答えて

0

これは最終的に私の仕事:

server 
{ 
    listen  80; 
    server_name mysite.com; 

    root /path/to/my/web; 
    index index.html index.php; 

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

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

} 
関連する問題