Quantcast
Channel: Nginx Forum - How to...
Viewing all articles
Browse latest Browse all 4759

NGINX and WebServices WSDL Reverse Proxy

$
0
0
Hello,

I have a server running Tomcat where it runs a WebService application on port 8080. To all external users, they will access the WebService on port 443 where Nginx will proxy reverse to port 8080. So, I have created the following configuration:

server {
listen 443;
server_name supermercado.cf;
ssl_certificate /.../certificate.crt;
ssl_certificate_key /.../certificate.key;
ssl on;
ssl_session_cache builtin:1000 shared:SSL:10m;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers HIGH:!aNULL:!eNULL:!EXPORT:!CAMELLIA:!DES:!MD5:!PSK:!RC4;
ssl_prefer_server_ciphers on;
access_log /var/log/nginx/supermercado.cf.access.log;
location / {
proxy_pass http://supermercado.cf:8080;
sub_filter '<a href="http://supermercado.cf:8080/' '<a href="https://$host/';
sub_filter_types text/css text/xml text/css;
sub_filter http://$host:8080 https://$host;
sub_filter_once on;
}
}

As you can see, I have used the proxy_pass directive to redirect all 443 traffic to port 8080 and I used a few sub_filter to replace the URL on the WebService page. The attached picture shows the Service URL, where the Address parameter is doing the right substitution by replacing the http://supermercado.cf:8080 URL by the https://supermercado.cf. However, the WSDL URL does not get replaced and keeps showing the URL pointing to port 8080.

Also, on the bottom of the picture you will see the same happening for the ?wsdl URL where the location also points to port 8080.

So, How can I setup NGINX to show all URLs pointing only to the HTTPS protocol?

Thanks in advanced,
Giancarlo

Viewing all articles
Browse latest Browse all 4759

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>