Alex G
Alex G

Reputation: 339

Access nginx from a custom url locally without nginx-proxy

Using docker-compose, our local environment is accessible through the domain "ourapp.local" (rather than localhost). To achieve this we followed this guide using nginx-proxy:

https://medium.com/@francoisromain/set-a-local-web-development-environment-with-custom-urls-and-https-3fbe91d2eaf0

Though this requires two seperate project files and increases the time it takes to do a fresh setup quite a bit.

How can we accomplish this without having two separate projects, even if it means including nginx-proxy in our project? Is it possible to do this using the local nginx container?

Upvotes: 0

Views: 148

Answers (1)

Alex G
Alex G

Reputation: 339

So it turns out you can just add nginx-proxy as a container inside your project's docker-compose, removing the network references but keeping the expose: -3000 (or whatever port you chose as the virtual port) on your nginx container config.

Upvotes: 0

Related Questions