-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hosting behind nginx? #46
Comments
-> https://github.com/bluesky-social/pds/blob/main/installer.sh#L320C1-L320C37 I just replaced caddy with cloudflared, so nginx will also work :-) |
I'm not sure what to do with that, I'm not familiar with docker nor caddy at all. I would also like to have instructions on how to host behind nginx |
Once you set up your site on nginx, you can set if you are running nginx on your node (not as container), you have to add the following entry into the docker compose services:
pds:
ports:
- 127.0.0.1:3000:3000 and then setting |
Is it possible to configure the PORT or HOST where the container will listen to? It seems hardcoded to 3000 and that is already used by other containers. And listen on the any interface is not helpful either here. It should at maximum listen on the docker network interface for that group of containers. |
You can decide to map the port 7001 of the host to port 3000 in the container. Just change it to
Specifying the address (127.0.0.1) will map the port only on that address instead of all NICs of the node. I'd recommend reading the docker documentation for further doubts. |
Well, that didn't fix my problem. As the inner docker container makes a listen to the any interface on 3000 it is already to late to map that port to another one. I have several nodejs containers in that server and some other is also using port 3000, so that gives an bind error on startup. But when change the port via PDS_PORT is is now solved in my case. |
Once you edit the compose file, you must restart the involved containers to make the changes take effect. As per container basics, each container has its own dedicated network namespace and the process can bind to whatever port it needs. When the containers are executed, the engine (in this case docker) has to expose the ports in another network, which could be the host or a virtual network. I guess this explains the context |
this is the nginx config i came up with for running without docker: |
I got it working behind nginx by doing the following :
Side note: I didn't know I could have one cert for the wildcard and the domain, so I actually needed to have two server blocks in the nginx config, one for the wildcard and one for the domain. I didn't need to change the port. |
Title says it all. In the real world deployments, we are not limited to Caddy. Providing instructions on how to host behind nginx would be a great addition.
The text was updated successfully, but these errors were encountered: