Apache, IIS and 502 proxy error
I have some servers in my network. There is one public Apache server that proxies requests to these servers. These servers are not directly visible from internet. Some of these servers run IIS and ASP.NET web applications. When accessing these servers through internet then sometimes Apache reports a problem: 502 proxy error.
After some digging in internet I found out what’s going on between Apache and IIS. There is very informative bug report in Apache issue tracker – Bug 37770 – proxy: error reading status line from remote server (null). Comment #17 states reason of error as follows:
The problem also only occurs for us when we use an IIS backend device, with an apache its ok. From a tcpdump the only diff I can see between the two sessions is that the IIS closes the connection when the keep-alive time out is reached with a TCP RST packet, while the apache does a Fin/Ack handshake. When IIS sends this RST packet the next request to the mod_proxy device that’s hits the worker with the RST connection returns the 502 error msg.
So, there is some misunderstandings between Apache proxy stuff and IIS. Although some guys suggest to use very long timeouts and hacks to Apache source code there is very simple fix that works very well for me. Make sure you have mod_env enabled and add these lines to Apache configuration file.
SetEnv force-proxy-request-1.0 1
SetEnv proxy-nokeepalive 1
After restarting Apache server the communication between Apache and IIS should work fine. After these modifications I have seen no error 502 anymore.
This post is very timely. I just set up dev environments for me and my co-workers at my job, and this issue has been frustrating us. Many thanks.
You are welcome :)
Nice blog
I am facing same problem. I have done the above mentioned changes SetEnv. But still getting the same error.I am using apache 2.2.3
This solution worked for me, thanks for posting it
Good Solution.. Worked for me..
Firstly, I would like to know the impact of 502 error. When the apache act as proxy reported 502, how the apache will assume the status of IIS servers?
On other hand, the two setenv will fallback to httpd/1.0 without keepalive. Does it may increaes the TCP sockets needed to be opened as no more keepalive?
This will increase the loading for the IIS server.
I am getting this error in two scenarious after this env setting is done,
if the request that is made from the browser is time taking/bigger size data as a result.
and observed if number of simultaneous requests are in the range of 5-10
Please help me
Althu, this was written in 2009, but helped me last day. Was having same issue and was unable to find root couse. This helps. Thanks a lot and keep up the good things.
Great! This is exactly what I was looking for and it works! Thanks!
I had a similar problem and resorted to turning of HTTP keep-alive among the common response headers in IIS. Works for both IIS6 and IIS7.
Checked out your Gateway IP, Same problem did hurt me also on inspection i found that i did’t give my Gateway IP to my LAN Card.
After upgrading my IIS backend from Windows 2003/IIS6 to Windows 2008/IIS7 I suddenly got 502 errors. Thanks to this post I was able to sort out the issue, thanks a lot!!!
Thanks DigiMortal, this solved a very big problem for me!
/ Jakob
Pingback:Fix Apache Error 502 Errors - Windows XP, Vista, 7, 8
Pingback:How To Fix Apache Error Reading From Remote Server in Windows
Hello, after reading this amazing paragraph i am too happy to share my know-how here with mates.
After I initially commented I appear to have clicked the -Notify
me when new comments are added- checkbox and from now on every time a comment
is added I recieve four emails with the exact same comment.
Is there a way you can remove me from that service? Cheers!
My web page: https://www.cucumber7.com/
Thanks for finally writing about > Apache, IIS and 502 proxy error < Liked it!
Hmm is anyone else encountering problems with the pictures on this blog loading?
I’m trying to determine if its a problem on my end or
if it’s the blog. Any feedback would be greatly appreciated.
Feel free to visit my page Slate roof sheets for Efficient coverage
My programmer is trying to persuade me to move
to .net from PHP. I have always disliked the idea because of
the costs. But he’s tryiong none the less. I’ve been using WordPress on various
websites for about a year and am concerned about switching to another
platform. I have heard very good things about blogengine.net.
Is there a way I can transfer all my wordpress
posts into it? Any kind of help would be really appreciated!
I’m no longer sure where you’re getting your info, however
great topic. I needs to spend a while learning more or understanding more.
Thank you for magnificent info I used to be on the
lookout for this info for my mission.
Very nice post. I just stumbled upon your weblog and wished to
say that I have truly enjoyed surfing around your blog posts.
After all I’ll be subscribing to your rss feed and I hope
you write again soon!
my site … Engine Performance
Very good site you hаve heee but I waѕ curious if you knew of any community forums that cover the same topics discussed here?
I’d really love to bbe a part of group where I can get
feed-back frⲟm other excperienced individuals that share the same interest.
If you have anny suggestions, please let me know.
Bless you!
Feel free to visit my page unblocked games 66
I just couldn’t depart your website before suggesting that I actually loved
the standard info an individual provide in your visitors? Is going to be back often to inspect new posts
Here is my blog … https://www.cucumber7.com/
This is my first time visit at here and i am really happy to read everthing at single place.
I have been surfing online more than 3 hours today, yet I never found any interesting article like yours.
It is pretty worth enough for me. In my view, if all website
owners and bloggers made good content as you did,
the web will be a lot more useful than ever before.
My web page :: Camshaft Timing Control
Best AI Galleries
Useful info. Lucky me I discovered your website by chance, and
I am shocked why this coincidence did not took place earlier!
I bookmarked it.
Thank you a bunch for sharing this with all folks you
actually recognize what you are talking about! Bookmarked.
Kindly also talk over with my website =). We could have a hyperlink
alternate arrangement between us
https://applewithbtcs.com/ Apple4 bitcoin | buy apple products with bitcoin and cryptocurrency
https://luxury.applebitcoins.com Apple bitcoins
| buy apple products with bitcoin and cryptocurrency
https://applebtcs.com Apple bitcoins | buy apple products with bitcoin and cryptocurrency
https://cryptobitmart.com Bull Miners | Crypto Mining Equipment
at Unbeatable Prices
https://applewithbtcs.com/ Apple4 bitcoin | buy apple products with
bitcoin and cryptocurrency
you’re in reality a just right webmaster. The website loading speed is amazing.
It sort of feels that you are doing any distinctive trick.
Furthermore, The contents are masterwork. you have performed a great process on this topic!
excellent points altogether, you simply won a new reader.
What might you suggest in regards to your post that you made a few
days ago? Any positive?
Een doordacht en prikkelend artikel. Ik heb hhet gedeeld op X (voorheen Twitter)
om te helpen de boodschap te verspreidenom het onder de aandacht te brengenom het te promotenom
de bekendheid te vergrotenom het te dele meet anderen.
Feel free to surf to my webpage – https://www.youtube888.com/
https://cryptobitmart.comCryptobitmart | Online Shopping
with Cryptocurrency
https://applewithbtcs.com/ Apple4 bitcoin | buy apple products
with bitcoin and cryptocurrency
What’s up colleagues, nice post and fastidious urging commented here, I am in fact enjoying by these.
Unquestionably believe that that you said. Your favourite justification seemed to be at
the net the simplest factor to remember of. I say to you, I definitely get
irked while other folks think about concerns that they just
do not recognize about. You managed to hit the nail upon the highest and outlined out the whole
thing with no need side effect , other people could take
a signal. Will likely be again to get more. Thanks
It’s perfect time to make some plans for the future and it is time to be happy.
I’ve read this post and if I could I want to suggest you some interesting things or tips.
Perhaps you can write next articles referring to
this article. I wish to read even more things about it!
global pet insurance market
The Private Instagram Viewer is a simple tool meant to allow you anonymously investigate public Instagram profiles without
logging into your own account. Whether you’re eager virtually a username,
want to look someones profile portray in full
size, or check out their bio and public posts, this tool makes it fast and private.