====== Alpine 安裝 Nginx 當 Web Proxy ======
\\
**建議改用 [[tech/nginx_proxy_manager|Nginx Proxy Manager]] 來替代** \\
\\
* 安裝環境 :
* 使用 PVE 7 的 CT Template - alpine-3.15-default_20211202_amd64.tar.xz
===== 安裝程序 =====
* 先更新預設套件
apk update
apk upgrade
* 安裝與設定 nginx
apk add nginx
adduser -g 'Nginx www user' -h /var/www/html webuser
vi /etc/nginx/nginx.conf
:
http {
:
client_max_body_size 0m;
:
#tcp_nopush on;
:
gzip on;
:
}
* 安裝 Let's Encrypt bot
apk add certbot certbot-nginx
apk add python3 python3-dev py3-pip build-base libressl-dev musl-dev libffi-dev rust cargo
* 將 Web Proxy 設定檔放入 /etc/nginx/http.d/ 內
* 設定啟動 nginx
rc-service nginx start
rc-update add nginx
===== 參考網址 =====
* https://www.cyberciti.biz/faq/how-to-install-nginx-web-server-on-alpine-linux/
* https://www.ichiayi.com/tech/nginx_proxy_real_ip
* https://geko.cloud/en/nginx-letsencrypt-certbot-docker-alpine/
{{tag>alpine nginx revers-proxy}}