Jeremy Davis's picture

Hi Michael. Firstly, I've enabled your TurnKey website user account, so please feel free to log in and your posts should be published straight away. (I.e. you shouldn't need to wait for me to publish).

When you say "more than one location section with a similar proxy pass section", how similar? Assuming mostly the same, I'd recommend moving all the config that is common to all your proxies into it's own config snippet file (call it proxy.conf and put it in /etc/nginx/snippets/). Add that 'proxy_hide_header Upgrade;' line this common proxy.conf. Then whenever you want to reuse that proxy conf within a server block, add the line 'include snippets/proxy.conf;'.

Hopefully that is clear enough and makes sense? If you're still a bit confused, check out our default Nginx ssl.conf config snippet file and see how we include that in our default landing page config.

It's perhaps not the best example (as the ssl.conf is only used once in the default landing page). But the point of doing it that way is the same. It allows a shared/default config snippet (in this case for TLS/SSL) that can easily be reused by any site.

If you have additional config for a specific proxy (that is not common), just add that after the include line.

Good luck.