502 Proxy Errors Between IIS and Apache2

I am currently running apache2 on a SUSE instance of @EC2 . As part of my site, my data uses mod_proxy to hit the REST server with IIS through Proxy/ReverseProxy .

After setting up my vhosts , turning on mod_proxy and setting my config, I found that I often encountered 502 errors. These errors had the flavor of Proxy Error and Bad Gateway . Having made some significant google, I found that there is a difference in how IIS and apache terminate their connections, which cause an error. After setting the following environment variables, performance improved markedly:

SetEnv force-proxy-request-1.0 1
SetEnv proxy-nokeepalive 1
SetEnv proxy-initial-not-pooled 1

What interests me is why this works and what ideal configuration will look like.

I understand that with Env variables:
I make an HTTP 1.0 request (which will standardize completion expectations)
DO NOT support live connections
DO NOT use merged connections
right?

What if I need to use merged connections? What if I want to use keep-alives? In short, I'm looking for best practices to replace the toothpick and glue solution that I am currently using

+6
source share
2 answers

I see that this question has existed for some time, so I thought I would drop my 2 cents. More of my experience anyway ...

As far as I know, these three env variables or settings are fine. Your understanding of them is also true. When I had this problem, I found this link to be helpful in explaining the problem. This only happens with IIS in the backend .... Just note that tuning with the built-in pool will affect performance in the case of Http / 1.0 clients ... I have never noticed anything, but only on the iis server there is 64 GB of RAM and several cores on the machine ... so I admit, Make sure that "it does not affect at all," all I know is that "you have no problems with enough resources" ...

To be honest, but by repeating the phrase about a toothpick, I know about dozens of production environments that implement this ... You can install other things and play with apache and change it to implement longer timeouts, etc., but I set these settings and it just works ...

I think I just wanted to say that you should not sleep over these settings. In my opinion, while I do not know if they are best practices, they are safe ...

Sorry, I can’t help anymore ...

Cheers Robin

+2
source

I think I get this error because the server runs out of hard disk space. Unusually, but it happens.

0
source

Source: https://habr.com/ru/post/924753/


All Articles