I’m currently using Trellis to serve a WP instance on domain1.com
. I want domain2.com
to proxy to a single page on domain1.com/page
, so without any redirections. I’ve found a WP plugin that’s supposed to do this:
But I have trouble instructing Trellis to achieve this. I’ve come up with the following definitions in wordpress_sites.yml
:
wordpress_sites:
domain1.com:
site_hosts:
- canonical: domain1.com
redirects:
- www.domain1.com
- canonical: domain2.com
redirects:
- www.domain2.com
This correctly links the complete domain2.com
to domain1.com
, without any redirections. I can access the same content on both sites. This is bad for SEO though, and I want to only use domain2.com
for a single domain1.com/page
.
I’ve tried using the plugin above in combination with this, but that doesn’t seem to have any effect.
I’ve also tried to disable the plugin and use NGINX config instead. I’ve put this file into the folder nginx-includes/domain2.com
:
server {
listen 80;
listen [::]:80;
server_name domain2.com;
location / {
proxy_redirect off;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass https://domain1.com/page/;
}
}
This doesn’t seem to do anything either.
I’ve seen separate topics on this forum asking for the same setup, but without any solutions.
It looks like this isn’t possible to achieve with Trellis alone. Any ideas?