I have a java server sending out a request where the path contains the hostname.
OTOH I've got an ancient django server (1.8) that figures (wrongly) that the hostname is part of the path, and always returns a 404.
Assuming that sending properly formed requests from java side is not possible, how would I go about modifying the request URL to something that can be properly redirected to, without actually redirecting? (a 30x is also unacceptable in this case).
Asked
Active
Viewed 35 times
0

dd_dent
- 31
- 7
-
[This question](https://stackoverflow.com/questions/9320693/is-there-a-way-to-alter-the-request-path-before-matching-the-urls) suggests that you could try replacing `request.path_info` in the `process_request` method of your middleware class. – Alasdair Apr 15 '19 at 16:30
-
Can you edit the question with an example of a malformed request URI and a good one after the modification that you want to achieve? – grouchoboy Apr 16 '19 at 13:39
1 Answers
0
I ended up doing a rewrite in nginx (using proxy_pass
).
I couldn't solve this at the application level in any feasible way.

dd_dent
- 31
- 7