iT邦幫忙

0

nginx 部署 使用網域的問題

使用 django + nginx + uwsgi 部署一個網站
買了一個網域測試
但只在同個區域網路可以連線
用手機網路連就沒辦法連上
請問是哪邊的設定要調整嗎?
附上我的nginx設定

# savemoney_nginx.conf

# the upstream component nginx needs to connect to
upstream django {
    server unix:///home/savemoneyenv2/savemoney/savemoney.sock; # for a file socket
    #server 127.0.0.1:8001; # for a web port socket (we'll use this first)
}
# configuration of the server
server {
    # the port your site will be served on
    listen      80;
    # the domain name it will serve for
    server_name savemoney.live; # substitute your machine's IP address or FQDN
    charset     utf-8;

    # max upload size
    client_max_body_size 705M;   # adjust to taste

    # Django media
    location /media  {
        alias /home/savemoneyenv2/savemoney/media;  # your Django project's media files - amend as required
    }

    location /static {
        alias /home/savemoneyenv2/savemoney/static; # your Django project's static files - amend as required
    }

    # Finally, send all non-media requests to the Django server.
    location / {
        uwsgi_pass  django;
        include     /home/savemoneyenv2/savemoney/uwsgi_params; # the uwsgi_params file you installed
    }
}

看更多先前的討論...收起先前的討論...
froce iT邦高手 1 級 ‧ 2018-09-10 22:22:39 檢舉
要確定你的ip有被DNS更新到。
在DNS我有添加了我的主機ip
froce iT邦高手 1 級 ‧ 2018-09-10 23:44:03 檢舉
剛剛traceroute savemoney.live了一下,ip是192.168.2.31?
內網ip?
性格妞 iT邦新手 2 級 ‧ 2018-09-11 10:16:33 檢舉
$ nslookup savemoney.live 8.8.4.4
Server: 8.8.4.4
Address: 8.8.4.4#53

Non-authoritative answer:
Name: savemoney.live
Address: 192.168.2.31

要解決的問題是:
是否有固定public IP?
防火牆是否有做 port forward 指到內網的 server?

尚未有邦友回答

立即登入回答