If your container opens a port to the outside, then you can use an Nginx proxy to serve this port from 127.0.0.1 on a domain.

In this example here, a Haven relay is running on port 3355 in a Docker container. The port is exposed to the outside. My Nginx server then serves this port with SSL and a domain.

location / {

proxy_pass http://127.0.0.1:3355;

proxy_set_header Host $host;

proxy_set_header X-Real-IP $remote_addr;

proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

proxy_set_header X-Forwarded-Proto $scheme;

proxy_http_version 1.1;

proxy_set_header Upgrade $http_upgrade;

proxy_set_header Connection "upgrade";

}

Let me get a full example.....

Sorry for asking again. Last time I setup an nginx server was 2015 and I don't know if docker was even a thing back then.

I made a new host in the default config. With you example.

The fact that my (not dockerised) nip-05 server is still working but the other page is just showing it as well tells me that I am on the right path and did not screw up anything major.

The "http2" parameter does not work for me though.

As it makes more and more fun to type words into a command line I guess I will figure it out today. Nginx manual is my lecture today.

Reply to this note

Please Login to reply.

Discussion

No replies yet.