Roots Discourse

Proxy a separate domain to a single page

I’m currently using Trellis to serve a WP instance on I want to proxy to a single page on, 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:

      - canonical:
      - canonical:

This correctly links the complete to, without any redirections. I can access the same content on both sites. This is bad for SEO though, and I want to only use for a single

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/

server {
	listen 80;
	listen [::]:80;

	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;


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?


Doesn’t the canonical link in the head take care of the double content SEO problem? With Yoast I think you can set the canonical url per page.

The nginx-includes folder should match your site name in wordpress_sites, in this case, so that explains the not working redirect

Indeed, it looks like Yoast handles that by setting the default canonical url to the WP permalink, so the duplicate content is OK.

I’ve tried putting the NGINX redirect under before, but then it complains about the server directive not being allowed in that place. But I do think I need to listen to the server directive, as I only need to proxy for server_name

Then you need to make a child template file if you want to use the server block:

Yeah, that’s a good pointer. I’ve dived deep into nginx-includes and have something half-working. But I’m also running into bugs causing double request headers, and unreliable requests (every other request fails). Either I just don’t understand it or Trellis isn’t made for this thing. It feels like I’m going against the principles of Trellis.

Nobody on this forum seems to have made it work yet: pointing a single domain to a page on another domain. Maybe this is just too complicated for Trellis?