Simon
Simon

Reputation: 6462

Why the "See It Work" section of the Docker https-portal gives me a "port 443: Connection refused" error?

I'm trying to make the Docker image steveltn/https-portal work on my VPS. I followed the prerequisites (I have Docker installed, the ports 80 and 443 are available and my domain name resolves to my machine (I could access it by http://claude.wtf).

I just copied the docker-copose.yml file:

https-portal:
  image: steveltn/https-portal
ports:
  - '80:80'
  - '443:443'
environment:
  DOMAINS: 'example.com'
  PRODUCTION: 'true'

And I changed the example.com by claude.wtf.
When I run the command docker-compose up -d, I don't have any errors, all seems to work well:

Name                 Command   State                  Ports                   
--------------------------------------------------------------------------------
root_https-portal_1   /init     Up      0.0.0.0:443->443/tcp, 0.0.0.0:80->80/tcp 

But if I try to access https://claude.wtf/ with curl I get this error: Failed to connect to claude.wtf port 443: Connection refused.

In order to avoid this error, I have done:

iptables -A INPUT -p tcp -m tcp --sport 443 -j ACCEPT
iptables -A OUTPUT -p tcp -m tcp --dport 443 -j ACCEPT 

And I don't seem to have any firewall activated since sudo ufw status verbose gives Status: inactive.

What could I have forgotten, or what am I doing wrong?

Upvotes: 1

Views: 527

Answers (1)

Simon
Simon

Reputation: 6462

I finally managed to make it work by doing these commands (I'm not sure to know which one make it worked):

iptables -I INPUT -p tcp --dport 443 --syn -j ACCEPT
iptables -A INPUT -m tcp -p tcp --dport 443 -j ACCEPT  

Upvotes: 1

Related Questions