views:

17

answers:

1

I'm wondering if it is bad practice to have a reverse proxy that selects the upstream server depending on the HTTP method used?

The background is that I have an abitrary web server that handles POST requests with some logic behind. The same resources also contain static content, that can be retrieved using GET. After some benchmarking I realized that nginx would handle the static content way faster than my abitrary web server doing this.

I checked the option to forward incoming requests internally using nginx, which is feasible.

But this would lead to the fact that different servers would serve a distinct resource, only depending on issuing a GET or POST, including different header fields.

+1  A: 

No, it's not bad practice, partitioning the tasks by the nature of the task is perfectly fine, as long as you don't need to store persistent per-user-session data on the server.

DVK