502 - Web server received an invalid response while acting as a gateway or proxy server. There is a problem with the page you are looking for, and it cannot be displayed. When the Web server (while acting as a gateway or proxy) contacted the upstream con

I am getting error while accessing url of lyncweb.domain.com, dialin.domain.com and meet.domain.com pointing to RP server.

502 - Web server received an invalid response while acting as a gateway or proxy server.

There is a problem with the page you are looking for, and it cannot be displayed. When the Web server (while acting as a gateway or proxy) contacted the upstream content server, it received an invalid response from the content server.

May 24th, 2014 12:36pm

Are you able to resolve your front end from the reverse proxy? (Either using a hosts file entry or DNS)
Free Windows Admin Tool Kit Click here and download it now
May 24th, 2014 9:13pm

Also if your resolution is working fine, but you're receiving the error still (and you're using Windows 2012). Try and load up this hotfix: http://www.microsoft.com/en-us/download/details.aspx?id=30333
May 25th, 2014 2:51am

For this issue, you can refer below link

http://support.microsoft.com/kb/2455129

Free Windows Admin Tool Kit Click here and download it now
May 25th, 2014 4:17pm

Any update on this?
May 29th, 2014 6:50pm

I tried to apply hotfix, but it shows it is not supported.

The certificate couldn't be validated because SSL negotiation wasn't successful. This could have occurred as a result of a network error or because of a problem with the certificate installation.

Elapsed Time: 669 ms.

A Web exception occurred because an HTTP 502 - BadGateway response was received from IIS7.

HTTP Response Headers:
Content-Length: 1477
Content-Type: text/html
Date: Tue, 03 Jun 2014 07:24:27 GMT
Server: Microsoft-IIS/8.0 Elapsed Time: 42689 ms.

Free Windows Admin Tool Kit Click here and download it now
June 3rd, 2014 7:25am

What operating system are you using?
June 3rd, 2014 7:09pm

We have Windows 2012 R2 server for Lync and Windows 2012 base os for Reverse Proxy and Edge SErver.
Free Windows Admin Tool Kit Click here and download it now
June 5th, 2014 11:21am

Sorry for the delay here, which hotfix did you attempt to load? The one I posted (http://www.microsoft.com/en-us/download/details.aspx?id=30333) definitely works on Windows 2012 (I've had to apply it a few times)

The second one that was posted applies to Windows 2008, so don't use that one.

June 18th, 2014 5:21pm



I am getting error while trying to install the above mentioned hotfix. 

My server configuration is : 

Free Windows Admin Tool Kit Click here and download it now
June 19th, 2014 12:56pm

Did you install IIS ARR2.5 or 3.0? If you installed 3, that would explain that.

Can I ask are you able to visit https://yourlyncfrontend.yourdomain.com:4443 from Internet Explorer on your Reverse proxy? Are you receiving any certificate errors? (if so, did you install the root certificate from your CA onto your Reverse Proxy)

June 19th, 2014 3:07pm

When i try with https://lyncfrontend.domain.local:4443 and https://lyncfrontend.domain.com:4443 both opens but when i open the external domain name i get certificate .

ARR version installed is 3.0



To throw more light on the configuration:

Lync 2013 implemented, internal domain name is : domain.local and external domain name is : domain.com

All servers in VMs are with 4 core processor, 24gb ram, 1TB drive.

Frontend : Windows 2012r2 with Lync 2012 Standard Edition - 1 No (192.168.10.100)

Edge : Windows 2012 with Lync 2012 Std - 1 No 
(192.168.11.101 DMZ) in workgroup

ISS ARR Reverse Proxy 3.0 : Windows 2012 with ARR and IIS configured. (192.168.11.102)

Certificate : Internal Domain root CA for internal and External (Digicert).

Internal Network : 192.168.10.x /24

External Network (DMZ) : 192.168.11.x /24

Public Firewall NAT to DMZ ip for firewall and RP server. So having two public IP facing external network.

Edge has : sip.domain.com, webconf.domain.com, av.domain.com

IIS ARR RP server has : lyncdiscover.domain.com, lyncweb.domain.com, meet.domain.com, dialin.domain.com

Have created SRV record in public : _sip.tls.domain.com >5061>sip.domain.com, _sipfederationtls._tcp.domain.com>5061>sip.domain.com, _xmpp-server._tcp.domain.com>5269>sip.domain.com

Installed frontend server using MS Lync server 2013 step by step for anyone by Matt Landis, Lync MVP.

Internal AD Integrated DNS pointing Front-end
Type of Record FQDN IP Description 
A sip.domain.com 192.168.10.100 Address internal Front End  or Director for internal network clients 
A admin.domain.com 192.168.10.100 URL Administration pool
A DialIn.domain.com 192.168.10.100 URL Access to Dial In 
A meet.domain.com 192.168.10.100 URL of Web services meeting
A lyncdiscoverinternal.domain.com 192.168.10.100 Register for Lync AutoDiscover service to internal users
A lyncdiscover.domain.com 192.168.10.100 Register for Lync AutoDiscover service to external users  
SRV Service: _sipinternaltls Protocol: _tcp Port: 5061 sip.domain.com Record pointer services to internal customer connections using TLS 
External DNS pointing Edge & Proxy

Type of Record FQDN IP Endpoint
A sip.domain.com x.x.x.100 Edge
A webconf.domain.com x.x.x.100 Edge
A av.domain.com x.x.x.100 Edge
SRV _sip._tls.domain.com sip.domain.com: 443 Edge
SRV _sipfederationtls._tcp.domain.com sip.domain.com:5061 Edge
A Meet.domain.com x.x.x.110 Reverse Proxy
A Dialin.domain.com x.x.x.110 Reverse Proxy
A lyncdiscover.domain.com x.x.x.110 Reverse Proxy
A lyncweb.domain.com x.x.x.110 Reverse Proxy
In IIS ARR proxy server following server farms are added and configured as per link ttp://y0av.me/2013/07/22/lync2013_iisarr/

In proxy server had setup only following server farm : While running remote connectivity web service test : meet, dialin, lyncdiscover and lyncweb.

The client inside works fine internally and through vpn. Login with external client also working fine. But we are getting error in MRCA as follows.

a) While testing remote connectivity for lync getting error : The certificate couldn't be validated because SSL negotiation wasn't successful. This could have occurred as a result of a network error or because of a problem with the certificate installation. Certificate was installed properly.

b) For remote web test under Lync throws error : A Web exception occurred because an HTTP 502 - BadGateway response was received from IIS7.
HTTP Response Headers:
Content-Length: 1477
Content-Type: text/html
Date: Wed, 14 May 2014 10:03:40 GMT
Server: Microsoft-IIS/8.0
Elapsed Time: 1300 ms.


Free Windows Admin Tool Kit Click here and download it now
June 22nd, 2014 12:56pm

Hello, I'm new to the party but why would you be using both: https://lyncfrontend.domain.local:4443 and https://lyncfrontend.domain.com:4443?

If this is Standard edition https://lyncfrontend.domain.com would not be defined in the topology so will always give you certificate errors and should not be used. Looking at your first post lyncweb.aig.sa seems to be your defined External Web Services URL.

The Reverse Proxy should be receiving: lyncdiscovery.aig.sa, lyncweb.aig.sa, dialin.aig.sa and meet.aig.sa (which looks to be valid on the certificate) and then proxy to the Front End server on 4443. The Reverse Proxy will need host file entries to resolve any of the "Server Address" defined when creating the IIS/AAR farm to the Front End's IP (example meet.aig.sa 192.168.10.100).

June 22nd, 2014 2:41pm

Host file entries are already in place on the RP server.  Yes standard edition. 

My issue is this while trying from internet lync client is not connecting with the server but while using vpn it works fine. So when i tried browsing the lyncdiscover  url from internet i am getting this error:

502 - Web server received an invalid response while acting as a gateway or proxy server.

There is a problem with the page you are looking for, and it cannot be displayed. When the Web server (while acting as a gateway or proxy) contacted the upstream content server, it received an invalid response from the content server.

Free Windows Admin Tool Kit Click here and download it now
June 23rd, 2014 2:39am

From the reverse proxy what happens when you use IE to browse lyncdiscovery.aig.sa, lyncweb.aig.sa, dialin.aig.sa and meet.aig.sa? Also what is the server address you defined during the creation of the IIS/ARR rules? Was it just the simple urls or did you use the Front End FQDN? If using the Front End did you make sure to use lyncfrontend.domain.local and not .com?
June 23rd, 2014 4:51am

IN IIS ARR WE HAVE CREATED the external domain name instead of creating domain.local. So is this the issue which is not allowing the routing request?

Now I have created for internal domain.local ARR and removed the old server farm in the ARR.  After changing it have rebooted the reverse proxy and checked. I get the same

Free Windows Admin Tool Kit Click here and download it now
June 23rd, 2014 11:38am

The destination fe.domain.com would give you certificate issues and would break proxying. domain.local should work. What happens when you use IE on the Proxy Server and browse to: lyncdiscovery.aig.sa, lyncweb.aig.sa, dialin.aig.sa, meet.aig.sa and lyncfrontend.domain.local?&nb
June 23rd, 2014 1:54pm

I assumed lyncweb.domain.com was your Lync External Web Services URL defined in the topology, is that correct?
Free Windows Admin Tool Kit Click here and download it now
June 23rd, 2014 2:16pm

Yes lyncweb.domain.com is my lync external web services url defined in the lync topology builder.

From Internet : When i tried to browse the webpage from external internet lyncdiscover.domain.com, lyncweb.domain.com and dialin.domain.com and meet.domain.com it throws the same error page.

From LAN network : lyncfrontend.domain.local it opens properly. When i tried to open all the url with same network it opens properly.

June 23rd, 2014 2:36pm

Right but what happens when you try the urls from the actual Reverse Proxy (IIS/ARR) se
Free Windows Admin Tool Kit Click here and download it now
June 23rd, 2014 3:54pm

when i tried from RP server for the following url :

https://meet.domain.com  or https://meet.domain.local or https://meet.domain.local:4443 or https://meet.domain.com:4443

<label class="errorbold" id="errorTextLabel15" style="display:block;">We're having trouble getting you into the meeting.</label>
<label class="errorregular" id="checkUrlLabel15" style="display:block;">It's possible you're using a bad URL. Try calling into the meeting using the phone number on the invite, or ask the organizer to drag you into the meeting from the Contacts list.</label>

https://dialin.domain.com or https://dialin.domain.local or https://dialin.domain.local:4443 or https://dialin.domain.com:4443

After accepting certificate it shows Blank page

https://lyncweb.domain.com or https://lyncweb.domain.local or https://lyncweb.domain.local:4443 or https://lyncweb.domain.com:4443

After accepting certificate it shows Blank page

June 24th, 2014 3:22am

The certificate for the External Webservices on the Front End, does it have lyncfrontend.domain.local on the SAN list? If not your IIS/ARR rules can't use lyncfrontend.domain.local as the "Server Address", since the simple URLs work from the proxy server you can create your rules so the "Server Address" matches the listener (example meet.domain.com would proxy to meet.domain.com instead of lyncfrontend.domain.local)
Free Windows Admin Tool Kit Click here and download it now
June 24th, 2014 4:47am

The external web services on the frontend server has lyncfrontend.domain.local in its internal SAN certificate. 
June 25th, 2014 5:38am

Does the Proxy Server trust the Internal Root CA and can access the CRL list over http?
Free Windows Admin Tool Kit Click here and download it now
June 25th, 2014 5:43am

Yes have imported the certificate from the root CA for the RP server
June 25th, 2014 4:24pm

Have you tried modifying the IIS/ARR rules to so the "Server Address" matches the listener (example meet.domain.com would proxy to meet.domain.com instead of lyncfrontend.domain.local)
Free Windows Admin Tool Kit Click here and download it now
June 25th, 2014 7:09pm

Yes have tried modifying the url and server address matching the server address and simple url. 
June 29th, 2014 6:12am

Are you running IIS 7.0? You need this hotfix: http://support.microsoft.com/kb/2455129
Free Windows Admin Tool Kit Click here and download it now
June 29th, 2014 4:08pm

it  is already been applied
June 30th, 2014 5:38am

Use logparser: http://www.microsoft.com/download/en/details.aspx?id=24659

And query the IIS logs:

SELECT 
Date, 
STRCAT(TO_STRING(sc-status), STRCAT('.', TO_STRING(sc-substatus))) As Status, 
COUNT(*) AS Hits 
FROM C:\inetpub\logs\LogFiles\W3SVC1\*.log
WHERE (sc-status = 502) 
GROUP BY Date, Status 
ORDER BY Date ASC

Have you run the Health Test in IIS/ARR ? : http://unifiedme.co.uk/2013/07/iis-arr-reverse-proxy-502-error/

Free Windows Admin Tool Kit Click here and download it now
June 30th, 2014 2:14pm

Hi Michael,

My apology for the delayed response, Have run the logparser, but couldn't succeed. It throws error on select date. 

C:\Program Files (x86)\Log Parser 2.2>logparser STRCAT(TO_STRING(sc-status), STR
CAT('.', TO_STRING(sc-substatus))) As Status, COUNT(*) AS Hits FROM C:\inetpub\l
ogs\LogFiles\W3SVC34578\*.log WHERE (sc-status = 502) GROUP BY Date, Status ORDE
R BY Date ASC
Error: detected extra argument "STRCAT('.'," after query

Also have gone through the http://unifiedme.co.uk/2013/07/iis-arr-reverse-proxy-502-error/ url and checked all the configurations and seems everything appears fine.

July 18th, 2014 9:24am

Can you place the SQL query within quotes (" ") and try again?
Free Windows Admin Tool Kit Click here and download it now
July 18th, 2014 2:24pm

Also I see you're missing the Select Date, at the beginning.
July 18th, 2014 2:25pm

Quick question have you unchecked "Enable Disk Cache" on the Farm? http://www.gecko-studio.co.uk/iis-arr-configuration-reverse-proxy-lync/
Free Windows Admin Tool Kit Click here and download it now
July 18th, 2014 2:33pm

Yes it is unchecked. Now i checked with the external clients the client could able to connect the server through internet without vpn. But voice and meeting doesn't work.
July 22nd, 2014 3:08am

Any luck using Log Parser for the IIS logs?
Free Windows Admin Tool Kit Click here and download it now
July 22nd, 2014 6:06am

i couldn't get the error log, i am getting error when i execute the command. 

SELECT Date, STRCAT(TO_STRING(sc-status), STRCAT('.', TO_STRING(sc-substatus))) As Status, COUNT(*) AS Hits FROM C:\inetpub\logs\LogFiles\W3SVC1\*.log WHERE (sc-status = 502) GROUP BY Date, Status ORDER BY Date ASC

Error: detected extra argument "STRCAT('.'," after query

August 4th, 2014 8:34am

Clear your IIS logs, access the site again externally, provide the logs here for review.

Also provide the details of the applicationhost.config file in %WINDIR%\system32\inetsrv\config

Free Windows Admin Tool Kit Click here and download it now
August 4th, 2014 7:04pm

Have attached the link of applicationhost.config file https://www.hightail.com/download/ZUcwYUord0E0b0E4RmNUQw

IIS Log file

#Software: Microsoft Internet Information Services 8.5
#Version: 1.0
#Date: 2014-08-27 00:01:46
#Fields: date time s-ip cs-method cs-uri-stem cs-uri-query s-port cs-username c-ip cs(User-Agent) cs(Referer) sc-status sc-substatus sc-win32-status time-taken
2014-08-27 00:01:46 10.4.60.166 GET /WebTicket/Issuer/ purpose=cwt 443 - 10.4.60.166 - - 200 0 0 41
2014-08-27 00:06:57 10.4.60.166 POST /locationinformation/liservice.svc/WebTicket_Bearer - 443 - 10.62.0.196 OC/15.0.4420.1017+(Microsoft+Lync) - 200 0 0 246
2014-08-27 00:07:15 10.4.60.166 POST /WebTicket/WebTicketService.svc/cert - 443 - 10.62.0.28 OC/15.0.4420.1017+(Microsoft+Lync) - 200 0 0 88
2014-08-27 00:07:15 10.4.60.166 POST /locationinformation/liservice.svc/WebTicket_Bearer - 443 - 10.62.0.28 OC/15.0.4420.1017+(Microsoft+Lync) - 200 0 0 256
2014-08-27 00:12:56 10.4.60.166 POST /locationinformation/liservice.svc/WebTicket_Bearer - 443 - 10.62.1.4 OC/15.0.4420.1017+(Microsoft+Lync) - 200 0 0 228
2014-08-27 00:25:58 10.4.60.166 POST /WebTicket/WebTicketService.svc/cert - 443 - 10.62.0.243 OC/15.0.4420.1017+(Microsoft+Lync) - 200 0 0 291
2014-08-27 00:26:00 10.4.60.166 POST /locationinformation/liservice.svc/WebTicket_Bearer - 443 - 10.62.0.243 OC/15.0.4420.1017+(Microsoft+Lync) - 200 0 0 258
2014-08-27 00:39:43 10.4.60.166 POST /CertProv/CertProvisioningService.svc/WebTicket_Proof - 443 - 10.62.0.196 OC/15.0.4420.1017+(Microsoft+Lync) - 500 0 64 41
2014-08-27 00:40:56 10.4.60.166 GET /WebTicket/Issuer/ purpose=cwt 443 - 10.4.60.166 - - 200 0 0 50

August 27th, 2014 1:59am

We were able to resolve it by importing the internal CA's root certificate on the reverse proxy.

Hope this helps others.

Free Windows Admin Tool Kit Click here and download it now
September 18th, 2014 6:04pm

Already had tried this one, we imported the internal CA root cert on reverse proxy. There is nothing blocked, pinging, able to reach lync server. Its weird one, i couldn't solve this issue.

a) The only stuff works is lync clients able to connect from internet.

b) Meeting url throws the same error which was mentioned in this thread.

c) Voice calls not working from external.

 
October 1st, 2014 11:38am

was this finally resolved ? if yes, how ? we hit a similar issue and want to understand what was the final fix
Free Windows Admin Tool Kit Click here and download it now
November 21st, 2014 8:14pm

I'm  having the same issues, have followed all the recommended resolutions . Does anyone have a update on this?
December 11th, 2014 12:13am

Hello,

Why do you say if you installed IIS ARR3 this would explain it? I have IIS ARR3 and am running into this issue....

Thanks

Free Windows Admin Tool Kit Click here and download it now
June 22nd, 2015 3:54pm

Hello,

I have the same issue for Shrepoint, but when I do a refresh page, it works. I think its some kind of timeout?

Regards

August 24th, 2015 6:50am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics