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.

Apache⇔Nginx設定置換早見表

Last updated at Posted at 2021-05-11

WEBサーバーをApache⇔Nginxで置換する場合に利用する設定の早見表です。

| Discription | Apache | Nginx |
|:-----------|:------------|:------------|:------------|
| WEBサーバーのバージョン非表示 | ServerTokens Prod | server_tokens off | nginx |
| ETagを作成しない | FileETag none | etag off | This |
| ヘッダのPHPバージョン非表示 | Header always unset X-Powered-By| fastcgi_hide_header X-Powered-By; | This |
| エラー表示を行う場合などに問い合わせ先となる連絡先メールアドレスまたは参照先 URL を設定 | ServerAdmin | エラーページに埋め込まない仕様 | This |
| サーバが自分自身を示す定義 | ServerName | server_name | This |
| バーチャルホストで使用するホストの別名を定義 | ServerAlias | server_name | This |
| 再起動無しで設定変更 | AllowOverride|機能なし | nginx |
| url書き換え有効 | RewriteEngine On | 不要 | This |
| サーバ変数を参照し正規表現と一致していれば(if文の役割) | RewriteCond %{HTTP:X-Forwarded-Proto} =http| if ($http_x_forwarded_proto != https) { } | This |
| 書き換えるurlの定義 | RewriteRule ^(/.)?$ https://%{SERVER_NAME}$1 [L,R] | rewrite ^(.)$ https://xxx$1 permanent | This |

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?