Setting up Nginx as reverse proxy for Apache by Ansible

Hey, does anyone know what playbooks or config files should I edit to make Ansible configure nginx as reverse proxy during deployment?
Any resources will help a lot, I struggle with this for way too long.

It would help if you could describe what end result you want. ie: where is the Apache server and what you are proxying exactly.

But either way it’s not going to be easy. Trellis isn’t set up for that configuration and depending on what you want it might take a lot of modifications.

1 Like

Here you can check what I want to achieve.

I want to make Apache serve dynamic files, and Nginx take care of statics.

You’d need to do a lot of work:

  • install Apache (via a Galaxy package or manually create a role)
  • Create all the necessary WP/PHP configuration we already have set up for Nginx into Apache
  • Completely re-do Nginx configs to just do static files + proxying

This would be a fork of Trellis and require a lot of changes. I have two recommendations:

  1. don’t use Trellis for this at all
  2. get rid of the Apache requirement if you can