Skip to content
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

Create central nginx proxy load balancer #243

Open
markshust opened this issue Mar 21, 2020 · 4 comments
Open

Create central nginx proxy load balancer #243

markshust opened this issue Mar 21, 2020 · 4 comments

Comments

@markshust
Copy link
Owner

The problem with the current setup is that you cannot have multiple instances of Magento running at the same time unless each of the services run on a separate port. This is not ideal and confusing.

Ideally, we want an Nginx load balancer to sit in front of everything. For example:

dm start will start this Nginx load balancer

We then need to "register" sites with the load balancer. For example dm register ~/Sites/mysite will register the site with the load balancer, as well as setup SSL. I was previously looking into and working with https://github.com/nginx-proxy/nginx-proxy -- this setup seemed to work fine for NodeJS apps, but it buckled around Magento's complex setup and when it came to running SSL.

It's possible this central nginx load balancer could become a project entirely on its own, as this is a common problem with all docker projects, not just docker-magento. We could use Kubernetes, but I'd like to keep things simple in local dev. I think a simple proxy which allows users to register and deregister sites with the load balancer, and automatically sets up SSL certs for mac & linux would be sufficient.

@markshust markshust added this to the 100.x milestone Mar 21, 2020
@markshust
Copy link
Owner Author

I was able to get nginx-proxy working with mkcert. This makes running multiple instances of Magento possible with local SSL.

Example repo at https://github.com/markshust/nginx-proxy-mkcert

@markshust markshust removed this from the 100.x milestone Mar 22, 2020
@walkwizus
Copy link

@dirkreitz
Copy link

for local development you might look into Minikube. Pretty interesting in my opinion, and the configuration could be easily transferred to Kubernetes later.

@bap14
Copy link

bap14 commented Jul 10, 2022

You could also leverage a project like Traefik to provide reverse proxy to multiple projects, and the only addition to this one would be some docker-compose.yml configuration changes (or potentially a docker-compose.traefik.yml file). There are some complexities with this, but it's how I generally run my projects and it works fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants