1

I ran into the following situation. A client provides a soap service on port 80. It's unknown how their clients access the service exactly but it assumed that they have the uris hardcoded in their scripts. Currently we are developing a new website for my client which will operate on the current domain. The soap service will be moved to a subdomain. Since they don't want to bother their clients with a domain change for the soap service I've been asked to forward all soap requests to the server on the subdomain.

My question now is, can this be done and how? I'm running an Nginx webserver on Ubuntu 14.04. Can we just forward this endpoint https://www.domain.nl/services/soap to https://subdomain.domain.nl/services/soap or do we need to use iptables for it? In case of iptables how can we separate soap requests from regular web requests?

Abel
  • 123
  • 1
  • 3

1 Answers1

2

You do not want to 301 clients to the new appropriate location, as this is technically a breaking change. The existing clients may not know how to follow a 301 redirect, or they may return an error if the response is anything but 200. You're changing a fundamental assumption and so the outcome is unpredictable and risky.

A better approach is to create a reverse proxy which will be invisible to the client. You would inspect the URL and match on ^/services/soap to proxy requests to the new SOAP endpoint. There are lots of well documented ways to do this with NGINX as well as HAProxy or Apache.

Joel E Salas
  • 5,562
  • 15
  • 25
  • I suppose "client conforms to spec" is not a reasonable assumption... – Michael Hampton Dec 21 '15 at 20:38
  • Thanks, that was exactly the kind of caveats I was looking for going the 301 way. I've set up the reverse proxy and it seems to be working fine. I did have to configure a resolver setting though to make it work. – Abel Dec 22 '15 at 08:55