Can't reach this page after install completed

I try to install peertube on a new ubuntu 22.04 server and follow the Chocobozzz/PeerTube production.md, anything seems fine. However, when I visit the site got an error « can’t reach this page ».
I have check some of similar topics, but still can’t find the solution.
Anyone can help me to find what is the problem?

sudo journalctl -fu peertube

Oct 04 08:24:59 video peertube[77305]: [video.itservices.hk:443] 2023-10-04 08:24:59.010 info: Using following configuration file hierarchy: /var/www/peertube/config/defig/production.yaml.
Oct 04 08:24:59 video peertube[77305]: [video.itservices.hk:443] 2023-10-04 08:24:59.016 warn: Emailer is disabled so the contact form will not work.
Oct 04 08:24:59 video peertube[77305]: [video.itservices.hk:443] 2023-10-04 08:24:59.018 warn: Directory of tmp_persistent should not be in the production directory of ion configuration file.
Oct 04 08:24:59 video peertube[77305]: [video.itservices.hk:443] 2023-10-04 08:24:59.857 info: Database peertube_prod is ready.
Oct 04 08:25:00 video peertube[77305]: [video.itservices.hk:443] 2023-10-04 08:25:00.354 info: Connecting to redis standalone...
Oct 04 08:25:00 video peertube[77305]: [video.itservices.hk:443] 2023-10-04 08:25:00.362 error: Cannot use SMTP server because of lack of configuration. PeerTube will n
Oct 04 08:25:00 video peertube[77305]: [video.itservices.hk:443] 2023-10-04 08:25:00.605 info: Connected to redis.
Oct 04 08:25:01 video peertube[77305]: [video.itservices.hk:443] 2023-10-04 08:25:01.156 info: HTTP server listening on 0.0.0.0:9000
Oct 04 08:25:01 video peertube[77305]: [video.itservices.hk:443] 2023-10-04 08:25:01.157 info: Web server: https://video.itservices.hk
Oct 04 08:27:00 video peertube[77305]: [video.itservices.hk:443] 2023-10-04 08:27:00.539 info: Cleaning video viewers.

netstat -plntu

Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 0.0.0.0:443             0.0.0.0:*               LISTEN      -
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      -
tcp        0      0 127.0.0.53:53           0.0.0.0:*               LISTEN      -
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      -
tcp        0      0 0.0.0.0:9000            0.0.0.0:*               LISTEN      -
tcp        0      0 127.0.0.1:6379          0.0.0.0:*               LISTEN      -
tcp        0      0 127.0.0.1:5432          0.0.0.0:*               LISTEN      -
tcp6       0      0 :::443                  :::*                    LISTEN      -
tcp6       0      0 :::22                   :::*                    LISTEN      -
tcp6       0      0 :::80                   :::*                    LISTEN      -
tcp6       0      0 ::1:6379                :::*                    LISTEN      -
udp        0      0 127.0.0.53:53           0.0.0.0:*                           -

Additional information

  • PeerTube instance URL: video.itservices.hk
  • PeerTube version: v5.2.1
  • NodeJS version: v18.17.1
  • Ffmpeg version: v4.4.2
  • Redis version: v7.2.1
  • PostgreSQL version: v14.9

Hello,

Might the firewall be enabled and not configured to let pass http and https protocols ?

sudo ufw status should return something like 80 ALLOW Anywhere or http ALLOW Anywhere

Yes, I have try disable firewall and enable the firewall, but still not work

Status: active

To                         Action      From
--                         ------      ----
Nginx HTTP                 ALLOW       Anywhere
22/tcp                     ALLOW       Anywhere
443                        ALLOW       Anywhere
Nginx HTTP (v6)            ALLOW       Anywhere (v6)
22/tcp (v6)                ALLOW       Anywhere (v6)
443 (v6)                   ALLOW       Anywhere (v6)

OK, but I see the HTTP server is listening on port 9000 (proxy ?)

Oct 04 08:25:01 video peertube[77305]: [video.itservices.hk:443] 2023-10-04 08:25:01.156 info: HTTP server listening on 0.0.0.0:9000
Oct 04 08:25:01 video peertube[77305]: [video.itservices.hk:443] 2023-10-04 08:25:01.157 info: Web server: https://video.itservices.hk
O

Maybe first, try to open 9000 port.

Forget what I said. 9000 is proxy port; thus, host internals.

I remember that sometimes I need to restart the server when reconfiguring the firewall. Should get a try.

Otherwise, on some web service, I had to handle the difference between 127.0.0.1 and 0.0.0.0, maybe this may guess a look at.

I think i may have a clue. You are using node 18. Starting with this version, « localhost » defaults to IPv6, not IPv4.

So, check your Peertube and Nginx config, to be sure there is no « localhost », but only IPv4 (or IPv6) addresses.

In the Peertube config/production.yaml file:

listen:
  hostname: '127.0.0.1'
  port: 9000

In nginx:

upstream backend {
  server 127.0.0.1:9000;
}

Also, you have this in the logs:

HTTP server listening on 0.0.0.0:9000

Should not be 0.0.0.0, but 127.0.0.1 or ::1. Check your Peertube config.

Thanks guys!!