2017-05-09 7 views
0

最初はすべて私の英語のために謝ります。私はnginxの初心者です:私は基本的な疑問があります:Nginx異なるディレクトリにあるいくつかのプロジェクト

単一のマシンを使用して、同じipと同じポートを持つnginx(複数の異なるディレクトリで区切られた)で複数のプロジェクトを提供する最も簡単な方法は何ですか?

example.com/project1 
example.com/project2 
example.com/project3 

心のこもった挨拶。

答えて

0

単一のサーバーブロック内に複数のロケーションディレクティブを配置して、プロジェクトごとに必要な作業を行うことができます。ロケーションディレクティブの内部は、実際にはプロジェクトの種類に依存します。私はいくつかのWordPressインスタンスを持っています。例えば、それらのロケーションディレクティブの中にfastcgi設定ラインがあります。

例:

server { 
    listen 80; 
    server_name example.com; 

    location /project1 { 
     # What goes here depends on what type of project this is. 
    } 
    location /project2 { 
     # What goes here depends on what type of project this is. 
    } 
    location /project3 { 
     # What goes here depends on what type of project this is. 
    } 
} 
関連する問題