Just a small snippet to get you started.
Placeholders, for the example:
int.server == internal server name
frontend.server == this server server
Placeholders, for the example:
int.server == internal server name
frontend.server == this server server
The actual example:
location / {
proxy_ssl_name int.server;
proxy_ssl_verify off;
proxy_cookie_domain int.server frontend.server
proxy_http_version 1.1;
proxy_buffering off;
set $referer $http_referer;
if ($http_referer ~* ^https://frontend.server/(.+)$) {
set $referer https://int.server/$1;
}
proxy_set_header Referer $referer;
proxy_pass https://int.server;
}
I haven't had the time to make something work with multiple backends - it seems like the grammar in nginx is lacking - will try again with another approach in the future.