safe-global / safe-infrastructure

One `docker-compose.yml` file to rule them all
MIT License
56 stars 92 forks source link

nginx vs localhost #80

Closed comverser closed 1 year ago

comverser commented 1 year ago

I’m planning to run this service locally. When setting up the chain and web hook, some fields require the NGINX domain (e.g. http://nginx:8000/). However, I couldn’t access these addresses using my browser and started to think that I should use “localhost” instead (e.g. http://localhost:8000/).

Could the reason for not being able to connect to the NGINX domain from the browser be because it’s running inside a Docker container? Should I be using the NGINX domain instead of localhost?”

Adding the chain at http://localhost:8000/cfg/admin/chains/chain/add/

Adding the web hook at http://localhost:8000/txs/admin/history/webhook/

hectorgomezv commented 1 year ago

Hello @comverser,

Yes, that nginx reference would be only accessible through the Docker Compose network created by the Docker engine when running the compose file descriptor, so you can't access it unless you map the ports to your localhost. If you plan to access Nginx ports from outside a container included in the compose file, you need port mappings. You can check how the port mapping in Docker Compose works in the official documentation.