nginx筆記
31 March 2020
cs
cs
nginx
reverse_proxy
此文章僅用來紀錄學習nginx
的過程
nginx發送信號
nginx -s signal
關閉nginx
# fast stop
nginx -s stop
# gracefully shotdown
nginx -s quit
重啟nginx
# changed configuration file will note be loaded until this command is evoked
nginx -s reload
systemctl
使用systemctl
來啟動nginx
retart nginx
sudo systemctl restart nginx
Configuration File Structure
simple directive
# simple directive example
# <name> <value>;
listen 8080;
block directive
# block directive example
# <name> {
# ...
# }
http {
server {
}
}
nginx.conf / site-enabled
在nginx.conf
最後可以看到會引入/site-enabled/*
所有檔案,在啟動nginx
時會先讀取nginx.conf
這個設定檔,而後會引入其他自訂的設定檔
# /etc/nginx/nginx.conf
...
http {
...
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
}