carlalexander / debops-wordpress

Your superpowered WordPress server in three commands.
GNU General Public License v3.0
440 stars 65 forks source link

multidomain forward #213

Open stefangweichinger opened 5 years ago

stefangweichinger commented 5 years ago

Situation: 2nd domain name "wp.2nd-domain.com" points to same IP as "wp.mydomain.com"

Added a mapping via https://de.wordpress.org/plugins/multiple-domain-mapping-on-single-site/

fwd works for http://wp.2nd-domain.com but not for https://wp.2nd-domain.com

ssl issues ... I assume I could edit varnish config to do the forward as well ...

wp.2nd-domain.com should just hop over to https://wp.mydomain.com and use the existing nginx plus LE-certs ...

I'd like to avoid reapplying the ansible-role ;-)

stefangweichinger commented 5 years ago

I edited /etc/nginx/sites-enabled/varnish.mydomain.com.conf and added a block for the 2nd domain. So far not very successful ...

carlalexander commented 5 years ago

Yeah, I assume it's an SSL issue. I've never had to do anything like that nor did I design debops for that use case in mind. That said, I know that you can't do HTTPS redirects at DNS level so it's really something that the project should be able to do.

It's just a bit out of scope at the moment. I'm still working on the next release with the new version of DebOps.

At a glance, you'd need to create a new PKI realm for wp.2nd-domain.com and generate a let's encrypt certificate for it. But you also need to have nginx configured to respond to the challenge so it might not be as simple as just copying the nginx configuration.

Sorry I can't be of more help

stefangweichinger commented 5 years ago

I think it should be enough to get the varnish-vhost-file right. I already have generated a cert for the 2nd domain and think of defining a 2nd https-server for that domain and let it forward to the primary vhost then. But I am not yet there ... still fiddling.

edit: maybe I should turn around things. Customer wants WP into a docker container, so using your role won't last long anymore ;-) and there I don't have varnish ... and will have to solve it via HAproxy etc