vim /etc/nginx/sites-available/default
將設定加入最後面
location / {
proxy_set_header Host $host;
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 $scheme;
# Fix the “It appears that your reverse proxy set up is broken" error.
proxy_pass http://Domain_or_IP;
proxy_read_timeout 90;
proxy_redirect http://Domain_or_IP https://Domain_or_IP;
}
最後重新啟動 nginx 服務:
sudo service nginx restart