Configuration and provisioning for sub-directory setup using Bedrock + Trellis

Hey guys,

so I currently have the following issue. Website 1 has a transparent proxy configured for a subdirectory This is proxying the requests to, a wp bedrock website.

I want to handle the requests for and also redirect users from to

So far I’ve changed the wp config file for the environment in bedrock (site/config/environments/production.php) for wp_home, wpsiteurl and wp_content_url to have the new URL.

Right now I can see the homepage of displayed under with adjusted permalinks and most assets load properly. But the login page via /wp/wp-admin is giving me a 404 and certain files in the wp/wp-includes folder are also causing 404s.

I’m pretty sure I’m missing something substantial in the nginx configuration, because the /wp location seems to be causing the issues here. Not really sure where to look next though and I’m not too familiar with the nginx location directive to figure it out at this point.

Would greatly appreciate some pointers of where to look next, or maybe someone has completed a similar setup before?

Ok, so I’ve implemented a solution a couple of days ago. Not sure if it is the cleanest, but maybe still helpful to someone in a similar situation.

Compared to a setup without a transparent proxy I had to adjust the following files:



  • change the location configured from / to /blog in 3 places (lines 163, 260, 288)
  • The webserver was provisioned and running in production for, but is now also receiving proxied requests with a header set to For everything to work properly, I had to add 2 new server blocks, so that the nginx server is now answering for both hosts ( and So basically add an if statement for production that sets the server_name to And another if statement for production to add 2 server blocks (http and https) that only redirect to


  • For everything like login and assets to work properly, I had to symlink the web directory, within itself as blog, really not sure about this part
  • I added this to roles/deploy/hooks/finalize-after.yml so it’s done after every deployment.

This topic was automatically closed after 42 days. New replies are no longer allowed.