Customers from the internet need to access a web server accessible only from VPN, the domain is internal.domain and I have no control over it. Internally, the main page to log in is caas.internal.domain:6643. To connect from the internet, the users log in to the URL login.external.domain:9943 pointing to the nginx that routes the traffic to caas.internal.domain:6643 through the VPN. The response traffic from caas.internal.domain is redirected to login.external.domain not problem. All internal.domain Urls in html, json, js are replaced with external.domain. The only issue is coming from the internal url below with query string parameters that it is not translated.
should be replaced with
with 1234 and 5678 dynamic.
this is my config:
server {
listen 9943 ssl;
listen 443 ssl;
server_name external.domain;
ssl_certificate /etc/nginx/ssl/mytest-web.crt;
ssl_certificate_key /etc/nginx/ssl/mytest-web.key;
location / {
resolver 8.8.8.8;
proxy_set_header Accept-Encoding "";
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
client_max_body_size 1g;
proxy_pass https://caas.internal.domain:6643$request_uri;
proxy_redirect https://caas.internal.domain:6643 https://login.external.domain:9943;
#sub_filter_types text/css text/xml text/javascript application/json;
sub_filter_types *;
sub_filter_once off;
sub_filter "caas.internal.domain:6643" "login.external.domain:9943";
}
}
How could I get internal urls variables replace with external urls with the same variables?
Hope that makes sense
Many thanks