教學 https://noob.tw/nginx-reverse-proxy/ 不確定 網域再申請一個A紀錄 是不是必要的步驟 在etc/nginx/sites-available中新增一個api.config 輸入以下內容 ``` server { listen 80; listen 443 ssl; server_name 新的A紀錄網址; ssl_certificate /etc/letsencrypt/live/新的A紀錄網址/fullchain.pem; ssl_certificate_key /etc/letsencrypt/live/新的A紀錄網址/privkey.pem; location / { # 反向代理到同一台主機的 3500 Port 這邊是localhost沒錯 proxy_pass https://localhost:3500; # 把 IP、Protocol 等 header 都一起送給反向代理的 server proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $http_x_forwarded_proto; } } ``` 再到這個地方 ``` cd /etc/nginx/sites-enabled ``` 建立軟連結 不知道幹嘛用的 ``` ln -s ../sites-available/api.config api.config ``` 檢查是否有default 和 api.config ``` ls -l ``` 確認有後 ``` systemctl restart nginx ```
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up