我正在嘗試將在我的本地計算機上運行的頁面鏈接到我的保留域名,但它似乎沒有被拾取。
我已經在 ubuntu 18.04 機器上安裝了 nginx。我有一個簡單的 hello world 教程檔案夾,其中包含以下 conf 設定:
server {
listen 81;
listen [::]:81;
server_name api.<my_domain>.net;
root /var/www/tutorial;
index index.html;
location / {
try_files $uri $uri/ =404;
}
}
我通過我的托管服務提供商啟用了動態 dns。然后我使用 ddclient 生成以下設定,在此處的第 2 步中輸入托管服務提供商提供的資料:https : //www.strato-hosting.co.uk/faq/webshop/this-is-how-easy-it -is-to-set-up-dyndns-for-your-domains/
# Configuration file for ddclient generated by debconf
#
# /etc/ddclient.conf
protocol=dyndns2
use=web
server=https://dyndns.strato.com/nic/update
login=<my_username>
password='<my_dyndns_password>'
api.<my_domain>.net
我還將 dhcp 客戶端編輯為 true:
# Configuration for ddclient scripts
# generated from debconf on zo 9 jan 2022 21:20:14 CET
#
# /etc/default/ddclient
# Set to "true" if ddclient should be run every time DHCP client ('dhclient'
# from package isc-dhcp-client) updates the systems IP address.
run_dhclient="true"
# Set to "true" if ddclient should be run every time a new ppp connection is
# established. This might be useful, if you are using dial-on-demand.
run_ipup="false"
# Set to "true" if ddclient should run in daemon mode
# If this is changed to true, run_ipup and run_dhclient must be set to false.
run_daemon="true"
# Set the time interval between the updates of the dynamic DNS name in seconds.
# This option only takes effect if the ddclient runs in daemon mode.
daemon_interval="300"
如果我從另一臺筆記本電腦嘗試以下操作,我會得到以下結果:
<internal_device_ip>:81在同一網路上的筆記本電腦上作業<external_ip_address>:81在外部網路上的筆記本電腦上作業api.<my_domain>.net:81失敗
我覺得我缺少一些簡單的配置設定來連接最后一個點。
uj5u.com熱心網友回復:
它引發了錯誤,因為我沒有將api.<my_domain>.net我的托管服務提供商添加為子域。一旦我這樣做了,我就可以api.<my_domain>.net:81從外部瀏覽器訪問。
轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/409328.html
標籤:
上一篇:無效的HTTP_HOST標頭:“subdomain.domain.com”。您可能需要將“subdomain.domain.com”添加到ALLOWED_HOSTS
