安裝 Nginx.
sudo apt-get install nginx
編輯 Nginx 設定檔
sudo nano /etc/nginx/sites-enabled/default
在最下面新增,<IP_address>,換成自己對外的IP
server { listen 80; server_name <IP_address>; root /var/www/example.com; location / { proxy_pass http://127.0.0.1:8069; proxy_redirect off; 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; } }
存檔重重啓nginx
/etc/init.d/nginx restart
沒有留言:
張貼留言