简体   繁体   English

使用反向代理将不同的域重定向到同一Apache

[英]Redirect different domains to the same apache using reverse proxy

Morning, 早上,

I'm running a dockerized envirovment (localy and on tutum for production) that consists of: 我正在运行一个dockerized环境(本地化和在tutum上进行生产),该环境包括:

  1. nginx reverse proxy with https://github.com/jwilder/nginx-proxy 使用https://github.com/jwilder/nginx-proxy的 nginx反向代理

  2. Multiple sets of containers that are mainly websites with apache and things. 多套容器,主要是带有Apache和其他内容的网站。

The reverse proxy relies on the environment variable VIRTUAL_HOST set on some apaches to redirect traffic and it works well both in development and production using different environment variables thanks to changing between foo.dev and foo.com on developent/production thanks to an aditional production.yml or different configuration on the stackfile on tutum. 反向代理依赖于某些修补程序上设置的环境变量VIRTUAL_HOST来重定向流量,并且由于使用了额外的生产,由于在开发人员/生产上在foo.dev和foo.com之间进行了更改,因此它在使用不同环境变量的开发和生产中均能很好地工作。 yml或tutum上stackfile上的其他配置。

But now I need to have both foo.com and foo.es served by the same web app (one will be the translation of the other provided by the same wordpress container). 但是,现在我需要将foo.com和foo.es都由同一个Web应用程序提供(一个将是由同一wordpress容器提供的另一个的翻译)。

What I think I need is to define multiple VIRTUAL_HOST on the stackfile/docker-compose.yml but I don't know if it's possible. 我想我需要在stackfile / docker-compose.yml上定义多个VIRTUAL_HOST,但我不知道是否可能。

Am I missing something? 我想念什么吗?

Is it possible to route both foo.com and foo.es to the same container with this setup? 使用此设置是否可以将foo.com和foo.es都路由到同一容器?

Thanks! 谢谢!

Ok, 好,

I just needed to separate the hosts by comas on the same VIRTUAL_HOST environment variable as stated in the documentation of the reverse proxy I was using 我只需要用逗号分隔同一VIRTUAL_HOST环境变量上的主机,如我正在使用的反向代理文档中所述

https://github.com/jwilder/nginx-proxy#multiple-hosts https://github.com/jwilder/nginx-proxy#multiple-hosts

Sorry! 抱歉!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM