HTTP Error 400 Authority! -- when client set for Mendix instance as a proxy
0
I know this is a weird question, but it's a weird situation. I am reverse engineering a 15-year-old device that communicates with its normal server over HTTP by POSTing XML payloads and receiving proper XML responses. Unfortunately, the device does not have easy access to configure its host server address. The device is push-only except for its ancient web UI. To change the actual host settings, the device must POST its settings XML, then receive an XML response containing the changed settings. I've created a Published REST Service that I can direct the device to POST its messages at. The device will communicate with the service once the host address is configured. I developed an interface with Node-RED before being introduced to Mendix. With Node-RED, I could set the device's proxy address to my Node-RED server and it would behave like it was talking to its host server without issue. Node-RED did not care that it was a "fake proxy". Mendix appears to care about that, because when set the device's proxy address to the Mendix-built app, I get the "HTTP Error 400 Authority!" message back from Mendix. I can't make this initial change with Mendix because it won't accept the "fake proxy" traffic from the device, and that's the only way to get access. Is there a setting or something I can change to fix this? I even tried routing the traffic through a nginx proxy set up to the modify the URL... This worked, but I was getting a lot of 499 errors from nginx, causing the device to fail the connection.
asked
David Ditton
1 answers
0
The problem might be related with the host parameter of the HTTP request.
Mendix app shall reject any request if the host parameter is different from what it's own host is set to.
I would suggest to put a reverse proxy (NGINX/Apache) in front of Mendix which rewrites the Host header of the original request to Mendix app's actual domain and forwards the request to Mendix.
Another alternative might be changing the hostname of the mendix server: