
ショコラ
Nginx の設定ファイルをテストするには?
「nginx -t」でキメマス。

もっさん先輩
nginx -t
手順
- nginx の設定ファイル変更後にテストします。
nginx -t
# nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
- 「test is successful」が表示されたら、nginx をリロードします。
service nginx reload
シチュエーション
nginx の設定ファイルを変更したが、反映させる前に設定ファイルの内容が正しいか確認したい。