# 无法访问互联网时出现“欢迎使用 nginx”

**URL:** https://meta.discourse.org/t/getting-welcome-to-nginx-with-no-access-to-internet/148900
**Category:** Self-hosting
**Created:** [2020年四月22日 19:19 UTC](https://meta.discourse.org/t/getting-welcome-to-nginx-with-no-access-to-internet/148900 "2020-04-22T19:19:31Z")
**Posts on this page:** 13
**Page:** 1

<div class="post-metadata">

### Author: ![FunTec](https://avatars.discourse-cdn.com/v4/letter/f/49beb7/32.png) [@FunTec](https://meta.discourse.org/u/FunTec)
#### Post date: [2020年四月22日 19:19 UTC](https://meta.discourse.org/t/getting-welcome-to-nginx-with-no-access-to-internet/148900/1 "2020-04-22T19:19:31Z")

</div>

您好，  
我在 nginx 和 Discourse 上遇到了同样的问题。总是显示“欢迎来到 nginx”页面，而不是 Discourse。  
DNS 和邮件服务器已配置，我是在本地部署，而非云端。  
我使用的是这份指南：[discourse/docs/INSTALL-cloud.md at main · discourse/discourse · GitHub](https://github.com/discourse/discourse/blob/master/docs/INSTALL-cloud.md)

全新 Ubuntu 安装信息如下：

```plaintext
Distributor ID: Ubuntu
Description: Ubuntu 19.10
Release: 19.10
Codename: eoan

lsof -i:80
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
docker-pr 23296 root 4u IPv6 62651 0t0 TCP *:http (LISTEN)

netstat -plnt
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 127.0.0.53:53 0.0.0.0:* LISTEN 819/systemd-resolve
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 906/sshd
tcp6 0 0 :::80 :::* LISTEN 23296/docker-proxy
tcp6 0 0 :::22 :::* LISTEN 906/sshd
tcp6 0 0 :::443 :::* LISTEN 23283/docker-proxy

```

请帮帮我 😄

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [2020年四月22日 20:07 UTC](https://meta.discourse.org/t/getting-welcome-to-nginx-with-no-access-to-internet/148900/2 "2020-04-22T20:07:37Z")

</div>

我建议使用 18.04 LTS，而不是即将停止支持的版本。

`docker ps` 显示什么？

---

<div class="post-metadata">

### Author: ![FunTec](https://avatars.discourse-cdn.com/v4/letter/f/49beb7/32.png) [@FunTec](https://meta.discourse.org/u/FunTec)
#### Post date: [2020年四月23日 06:59 UTC](https://meta.discourse.org/t/getting-welcome-to-nginx-with-no-access-to-internet/148900/3 "2020-04-23T06:59:25Z")

</div>

```docker
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
01b8b484088b local_discourse/app "/sbin/boot" 12 hours ago Up 12 hours 0.0.0.0:80->80/tcp, 0.0.0.0:443->443/tcp app

```

我也尝试了 Debian 9 和 10。  
我还会尝试 Ubuntu 18.04 LTS 并记录结果。

---

<div class="post-metadata">

### Author: ![Stephen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/stephen/32/95011_2.png) [@Stephen](https://meta.discourse.org/u/Stephen)
#### Post date: [2020年四月23日 07:12 UTC](https://meta.discourse.org/t/getting-welcome-to-nginx-with-no-access-to-internet/148900/4 "2020-04-23T07:12:19Z")

</div>

如果您不断擦除并重建，Let’s Encrypt 将暂时停止颁发证书。

---

<div class="post-metadata">

### Author: ![FunTec](https://avatars.discourse-cdn.com/v4/letter/f/49beb7/32.png) [@FunTec](https://meta.discourse.org/u/FunTec)
#### Post date: [2020年四月23日 09:52 UTC](https://meta.discourse.org/t/getting-welcome-to-nginx-with-no-access-to-internet/148900/5 "2020-04-23T09:52:09Z")

</div>

服务器可以访问互联网，但无法从互联网访问，且 DNS 以 .lan 结尾。  
那么……Let’s Encrypt 是否还起作用？因为认证机构无法从互联网进行检查？

我安装了 Ubuntu 18.04 LTS，遇到了同样的问题。

```plaintext
lsb_release -a:
Distributor ID: Ubuntu
Description: Ubuntu 18.04.4 LTS
Release: 18.04
Codename: bionic

lsof -i:80
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
docker-pr 1598 root 4u IPv6 21087 0t0 TCP *:http (LISTEN)

netstat -tulpn:
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 127.0.0.53:53 0.0.0.0:* LISTEN 854/systemd-resolve
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1233/sshd
tcp6 0 0 :::80 :::* LISTEN 1598/docker-proxy
tcp6 0 0 :::22 :::* LISTEN 1233/sshd
tcp6 0 0 :::443 :::* LISTEN 1583/docker-proxy
udp 0 0 127.0.0.53:53 0.0.0.0:* 854/systemd-resolve

docker ps:
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
798e15496293 local_discourse/app "/sbin/boot" 2 hours ago Up 3 minutes 0.0.0.0:80->80/tcp, 0.0.0.0:443->443/tcp app

```

---

<div class="post-metadata">

### Author: ![Stephen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/stephen/32/95011_2.png) [@Stephen](https://meta.discourse.org/u/Stephen)
#### Post date: [2020年五月9日 20:55 UTC](https://meta.discourse.org/t/getting-welcome-to-nginx-with-no-access-to-internet/148900/6 "2020-05-09T20:55:37Z")

</div>

> [@FunTec](#):
>
> 服务器可以访问互联网，但无法从互联网访问，且 DNS 以 .lan 结尾。

来自 [安装指南](https://github.com/discourse/discourse/blob/master/docs/INSTALL-cloud.md)

> 🔔 Discourse 无法通过 IP 地址运行，您必须拥有一个域名（例如 `example.com`）才能继续。

如果您未使用有效的公共 FQDN，则常规安装路径将无法适用。本地 DNS 条目与域名在此处不可互换。Let’s Encrypt 将会失败，因为该 DNS 条目无效。

您需要手动修改 app.yml 以禁用 HTTPS 和 Let’s Encrypt。注释掉不必要的模板以及暴露 443 端口的条目。

除非您计划签发自签名证书，否则所有内容都将通过 HTTP 提供。

---

<div class="post-metadata">

### Author: ![mapengfei-nwpu](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mapengfei-nwpu/32/203450_2.png) [@mapengfei-nwpu](https://meta.discourse.org/u/mapengfei-nwpu)
#### Post date: [2020年十二月16日 13:43 UTC](https://meta.discourse.org/t/getting-welcome-to-nginx-with-no-access-to-internet/148900/7 "2020-12-16T13:43:52Z")

</div>

你好，Stephen！

我在 Fun Tec 上也遇到了同样的问题。我拥有自己的域名，我认为问题不在 Let’s Encrypt。以下是我执行 `sudo ./launcher restart app` 命令后的日志。你能从中找到一些有用的信息吗？

```plaintext
正在关闭
run-parts: 正在执行 /etc/runit/3.d/01-nginx
ok: down: nginx: 0s, normally up, want up
run-parts: 正在执行 /etc/runit/3.d/02-unicorn
(2165) 退出
ok: down: unicorn: 1s, normally up
run-parts: 正在执行 /etc/runit/3.d/10-redis
ok: down: redis: 0s, normally up
run-parts: 正在执行 /etc/runit/3.d/99-postgres
ok: down: postgres: 0s, normally up
ok: down: nginx: 2s, normally up
ok: down: postgres: 0s, normally up
ok: down: redis: 1s, normally up
ok: down: unicorn: 2s, normally up
ok: down: cron: 0s, normally up
ok: down: rsyslog: 0s, normally up
run-parts: 正在执行 /etc/runit/1.d/00-ensure-links
run-parts: 正在执行 /etc/runit/1.d/00-fix-var-logs
run-parts: 正在执行 /etc/runit/1.d/01-cleanup-web-pids
run-parts: 正在执行 /etc/runit/1.d/anacron
run-parts: 正在执行 /etc/runit/1.d/cleanup-pids
正在清理过期的 PID 文件
run-parts: 正在执行 /etc/runit/1.d/copy-env
run-parts: 正在执行 /etc/runit/1.d/letsencrypt
[2020 年 12 月 16 日 星期三 下午 01:26:10 UTC] 使用 CA: https://acme-v02.api.letsencrypt.org/directory
[2020 年 12 月 16 日 星期三 下午 01:26:10 UTC] 单个域名='a.mapengfei.xyz'
[2020 年 12 月 16 日 星期三 下午 01:26:10 UTC] 正在为每个域名获取授权令牌

```

---

<div class="post-metadata">

### Author: ![mapengfei-nwpu](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mapengfei-nwpu/32/203450_2.png) [@mapengfei-nwpu](https://meta.discourse.org/u/mapengfei-nwpu)
#### Post date: [2020年十二月17日 03:41 UTC](https://meta.discourse.org/t/getting-welcome-to-nginx-with-no-access-to-internet/148900/8 "2020-12-17T03:41:51Z")

</div>

嗨 FunTec！

我想您还没有安装 netcat。希望这能帮到您！

---

<div class="post-metadata">

### Author: ![PeterRushkin1](https://avatars.discourse-cdn.com/v4/letter/p/ee59a6/32.png) [@PeterRushkin1](https://meta.discourse.org/u/PeterRushkin1)
#### Post date: [2022年四月11日 11:02 UTC](https://meta.discourse.org/t/getting-welcome-to-nginx-with-no-access-to-internet/148900/9 "2022-04-11T11:02:57Z")

</div>

您好。

我遇到了完全相同的问题。

我从一个全新的 Ubuntu 安装开始：20.04.3 LTS

澄清一下，没有。之前没有安装 Nginx。

这是安装日志的链接：[install](https://www.mediafire.com/file/4wpuqeio52myewe/install.txt/file)

如何解决，谢谢。

---

<div class="post-metadata">

### Author: ![tknospdr](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tknospdr/32/529762_2.png) [@tknospdr](https://meta.discourse.org/u/tknospdr)
#### Post date: [2025年四月25日 18:47 UTC](https://meta.discourse.org/t/getting-welcome-to-nginx-with-no-access-to-internet/148900/10 "2025-04-25T18:47:49Z")

</div>

我在这里遇到了同样的问题。  
全新安装的 Ubuntu 24 LTS。  
Bootstrap 完成后，出现 Nginx 默认页面。  
当我运行 `./discourse-doctor` 时，我得到：

```plaintext
DISCOURSE DOCTOR Fri Apr 25 06:19:55 PM UTC 2025
OS: Linux talk 6.8.0-58-generic #60-Ubuntu SMP PREEMPT_DYNAMIC Fri Mar 14 18:29:48 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux

Found containers/app.yml

==================== YML SETTINGS ====================
DISCOURSE_HOSTNAME=talk.technospider.com
SMTP_ADDRESS=smtppro.zoho.com
DEVELOPER_EMAILS=REDACTED 
SMTP_PASSWORD=REDACTED 
SMTP_PORT=587
SMTP_USER_NAME=david@technospider.com
LETSENCRYPT_ACCOUNT_EMAIL=REDACTED 

==================== DOCKER INFO ====================
DOCKER VERSION: Docker version 26.1.3, build 26.1.3-0ubuntu1~24.04.1

DOCKER PROCESSES (docker ps -a)

CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS                                           
                           NAMES
394018ecf271 local_discourse/app “/sbin/boot” 21 minutes ago Up 21 minutes 0.0.0.0:80->80/tcp, :::80->80/tcp, 0.0.0.0:443->
443/tcp, :::443->443/tcp app

Discourse container app is running

==================== PLUGINS ====================
          - git clone https://github.com/discourse/docker_manager.git

No non-official plugins detected.

See https://github.com/discourse/discourse/blob/main/lib/plugin/metadata.rb for the official list.

========================================
Discourse version at talk.technospider.com: NOT FOUND
Discourse version at localhost: NOT FOUND

==================== MEMORY INFORMATION ====================
OS: Linux
RAM (MB): 4055

               total used free shared buff/cache available
Mem: 3867 1695 174 56 2345 2172
Swap: 3866 98 3768

==================== DISK SPACE CHECK ====================
---------- OS Disk Space ----------
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/ubuntu--vg-ubuntu--lv 19G 12G 6.0G 66% /

==================== DISK INFORMATION ====================
Disk /dev/loop0: 44.45 MiB, 46604288 bytes, 91024 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk /dev/loop1: 73.89 MiB, 77475840 bytes, 151320 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk /dev/loop2: 144.46 MiB, 151478272 bytes, 295856 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk /dev/sda: 40 GiB, 42949672960 bytes, 83886080 sectors
Disk model: VMware Virtual S
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 57115BC0-AFA9-4902-9910-BB09315092BA

Device Start End Sectors Size Type
/dev/sda1 2048 2203647 2201600 1G EFI System
/dev/sda2 2203648 6397951 4194304 2G Linux filesystem
/dev/sda3 6397952 83884031 77486080 36.9G Linux filesystem

Disk /dev/mapper/ubuntu--vg-ubuntu--lv: 18.47 GiB, 19834863616 bytes, 38739968 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

==================== END DISK INFORMATION ====================

==================== MAIL TEST ====================
For a robust test, get an address from http://www.mail-tester.com/
Sending mail to REDACTED . . 
Testing sending to technospider@icloud.com using smtppro.zoho.com:587, username:david@technospider.com with plain auth.
SMTP server connection successful.
Sending to technospider@icloud.com. . . 
Mail accepted by SMTP server.
Message-ID: 9e763c7d-b64d-4119-8f74-edd47154a799@talk.technospider.com

If you do not receive the message, check your SPAM folder
or test again using a service like http://www.mail-tester.com/.

If the message is not delivered it is not a problem with Discourse.
Check the SMTP server logs for the above Message ID to see why it
failed to deliver the message.

==================== DONE! ====================

```

并且测试邮件如期送达。  
我觉得我离成功很近了。

docker ps：

```plaintext
394018ecf271 local_discourse/app “/sbin/boot” 47 minutes ago Up 47 minutes 0.0.0.0:80->80/tcp, :::80->80/tcp, 0.0.0.0:443->
443/tcp, :::443->443/tcp app

```

服务器上没有安装 nginx 或 apache2。

---

<div class="post-metadata">

### Author: ![tknospdr](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tknospdr/32/529762_2.png) [@tknospdr](https://meta.discourse.org/u/tknospdr)
#### Post date: [2025年四月25日 19:14 UTC](https://meta.discourse.org/t/getting-welcome-to-nginx-with-no-access-to-internet/148900/11 "2025-04-25T19:14:26Z")

</div>

为了澄清一下，看起来 nginx 页面仅在从主机计算机访问主机名时可用，网络上的任何其他计算机都会收到连接失败的错误。

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [2025年四月25日 21:37 UTC](https://meta.discourse.org/t/getting-welcome-to-nginx-with-no-access-to-internet/148900/12 "2025-04-25T21:37:03Z")

</div>

您运行了 `./discourse-setup` 吗？连接测试通过了吗？

---

<div class="post-metadata">

### Author: ![tknospdr](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tknospdr/32/529762_2.png) [@tknospdr](https://meta.discourse.org/u/tknospdr)
#### Post date: [2025年四月26日 00:29 UTC](https://meta.discourse.org/t/getting-welcome-to-nginx-with-no-access-to-internet/148900/13 "2025-04-26T00:29:55Z")

</div>

是的，./discourse-setup 是引导顺序，对吧？我认为如果我没有运行它，容器就不会运行。我遵循了[此处](https://github.com/discourse/discourse/blob/main/docs/INSTALL-cloud.md)的说明，大约 7 分钟后，我看到了“欢迎使用 NGINX”页面。

您希望我运行特定的连接测试吗？设置过程中输出了太多内容，我无法全部捕获。
