LoginSignup
7
7

More than 5 years have passed since last update.

nginx の設定一覧の出力

Posted at

nginx の設定ファイル(config)では、includeで複数ファイルを
読み込むことができます。
共通ファイルや特定ドメイン向けの設定をファイルに切り出して……みたいな
使い方をするのですが、
複数ファイルに分けていると最終的にどんな設定になったのかがわかりにくのです。

そんな時には、どんな設定になったかを確認する方法が提供されています。

# nginx -T

これを実行すると次のような結果が出力されます。

nginx: [warn] duplicate MIME type "text/html" in /etc/nginx/sites-enabled/elasticbeanstalk-nginx-docker-proxy.conf:11
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
# configuration file /etc/nginx/nginx.conf:
# Elastic Beanstalk Nginx Configuration File

user  nginx;
worker_processes  auto;

error_log  /var/log/nginx/error.log;

pid        /var/run/nginx.pid;

events {
    worker_connections  1024;
}

http {

便利ですね。
注意点としては、これはすべてのnginxのconfigファイルから読み込んだものを
出力しているだけで、メモリから取得しているわけではありません。

メモリから取得する方法は、Dump nginx config from running process?を参照してください。

7
7
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
7
7