0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Nginxの設定

0
Posted at

Nginxについて調べたこと殴り書き

location{}=URIのパス毎の設定

リクエストURIのパスが、locationディレクティブのパス条件に一致した場合、設定が適応される。
※@は名前付きロケーション
パスの代わりに、unicornのように名前を付け、名前付きロケーションを作ることができる。内部リダイレクトで利用できる。

try_files

存在をチェックするファイルやディレクトリと存在しなかったときにリダイレクトするURIのパスを指定

  • try_files ファイル ... パス;
  • try_files ファイル... =コード;
    指定したファイルやディレクトリの存在を順に調べ、存在すればそのファイルやディレクトリに対応したファイルを返す。
    1つも存在しなかったら、最後に記述したパスに内部リダイレクトさせる。
    パスの代わりに名前付きロケーションを設定することもできる。

upstream

Nginxをひとまとまりのサーバーと一緒に使うためにグループを定義する

server

listen 使用するIPやポートを指定
server_name ホスト名
root ドキュメントルートを指定
location 任意のURIごとに異なる設定をするためのもの /なら全部

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?