this post was submitted on 07 Jul 2023
3 points (100.0% liked)
Lemmy Support
4654 readers
21 users here now
Support / questions about Lemmy.
founded 5 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
There's two NGINX servers in the Docker setup: one on the inside, and one on the outside/on the host.
If you run NGINX from the host or outside of the docker-compose,
lemmy
andlemmy-ui
won't resolve because that only exists within Docker. It does a bit of magic that essentially amounts to putting these in the containers'/etc/hosts
and maps to the internal IPs that the containers get. Docker has some sort of virtual router built-in, each compose gets its own virtual network and everything.If you use the Docker setup, you can use the configs I linked from the Ansible repo essentially as-is with minor tweaks. The internal NGINX config can be kept completely unchanged, and the outside one only needs minor tweaks to set up your own hostname and the port for the internal one. You only need to fill in the
{{domain}}
and{{lemmy_port}}
placeholders in the outside one. The example outside NGINX config already listens to both 80 and 443.Basically with the suggested setup, you go Internet -> your server (port 80/443) -> the internal NGINX in Docker (port 1236) -> lemmy/lemmy-ui.
Hello !
I followed your instructions, taking the:
and sticking:
in the "http {" section + changing all the {{domain}} to lemmy.mindoki.com and changing the {{lemmy_port}} to 1236 (FYI: 0.0.0.0:1236 hits up Lemmy locally)
Saving it all off in the nginx nginx.conf file.
I feel exceedingly stupid, but is this the way to go? Because I get this error when I reload nginx:
nginx: [emerg] host not found in upstream "lemmy:8536" in /etc/nginx/nginx.conf:111
Cheers and thanks again!
Edit: removing the upstreams, changed the backend proxy_pass, but to no avail...
Can you describe your setup in more details? Are you using the Docker setup with also NGINX running on the host outside of Docker?
If so,
nginx_internal.conf
must be passed in as a volume to the inner NGINX via the docker-compose. On the host, you only need the bits fromnginx.conf
. Don't try to use the internal ones, it doesn't make sense.If you post your configs it will be easier to pinpoint exactly what's wrong. Also paste the output of
docker ps
.I'm off one week on holidays, will sure post all config when I come back, thanks again!