none
Accessing WCF through a reverse proxy? RRS feed

  • Question

  • Here's how I want external clients to access my WCF service..

    IIS (in the DMZ.. address http://test.company.com) -> Reverse Proxy (pointing to http://servername/WCFService.svc) -> Biztalk Server with IIS

    But it doesn't work.  If I go to http://servername/WCFService.svc internally, it works.  And my reverse proxy works for normal ASP.NET applications.  But it doesn't work for WCF services..

    Through my painful google searching, I have found that setting the host headers in IIS would fix this. BUT that's only good if the Biztalk / IIS server was in the DMZ.. which it's not.  Is there another way of doing this?  An easier way?


    Tuesday, October 13, 2009 3:36 PM

Answers

All replies

  • Usually the reverse proxy is done so that the DMZ works properly with it. For example, ISA has to usually be configured to handle the reverse proxy. Otherwise, you would need to implement some type of custom functionality. This Code Project article gives a basic idea: http://www.codeproject.com/KB/web-security/HTTPReverseProxy.aspx. I wonder whether the WCF viaUri service behavior gives you what you are trying to accomplish with a reverse proxy.  

    The MSDN documentation is all old on this - they assume SOAP ports.

    Thanks,
    If this answers your question, please use the "Answer" button to say so | Ben Cline
    Wednesday, October 14, 2009 6:13 PM
    Moderator
  • Hi,unlikely

    Could you clarify these questions?

    ->"But it doesn't work."
    Could you define "doesn't work". Could you access the IIS in DMZ, Could you access Reverse Proxy? Could you access BizTalk/IIS server? Did you get any error messages?

    ->" If I go to http://servername/WCFService.svc internally, it works."
    "internally", you mean the internal  network of BizTalk/IIS Server , right?

    ->"And my reverse proxy works for normal ASP.NET applications.  But it doesn't work for WCF services.."
    ASP.NET apps and WCF services you mentioned here are hosted in the IIS with the BizTalk , right?

    ->"Through my painful google searching, I have found that setting the host headers in IIS would fix this. BUT that's only good if the Biztalk / IIS server was in the DMZ"
    I am confused about this statement:
       Which IIS are you indicating, the one in DMZ or the one with BizTalk.
       What do you mean "fix this", since you change the condition - "if the BizTalk/IIS server WAS in the DMZ"

    Regards
    Microsoft Online Community Support
    Friday, October 16, 2009 3:39 AM
    Moderator
  • Okay.. well it turns out it was the reverse proxy..

    I was using this one: http://urlrewriter.codeplex.com/  and although the guy who made it claims to have gotten it working with SVC files.. I tried for many days to do it..  and could never get it working..  

    When I called microsoft.. they told me to use Windows 2008 / IIS 7.0 as they've created a new URL Rewriter module for it:  


    And that took me half a day to figure it all out and get it working.

    So for those people who are looking to use a reverse proxy to point to an internal Biztalk machine, use Windows 2008 / IIS 7.0.. it makes it so quick.
    • Marked as answer by unlikely Friday, October 16, 2009 7:01 PM
    Friday, October 16, 2009 7:01 PM
  • Hi unlikely,

    I'm glad to know you got it sorted out. I'm likely dealing with the same thing that I would like to ask for your help. Internally my WCF service is accessible but from external network, WCF seems not to be resolved through IIS reverse proxy. I used Fiddle Web Debugger to trace network traffic and even checked in IIS log. The WCF service always got HTTP 404 error that basically meant it couldn't be reached from external network. I'm wondering if there is an outbound rule that I must create and configure before getting WCF service to be resolved completely.

    Your suggestion would be very much appreciated.

    Regards,
    -T.s


    Thuan Soldier
    A 23-year-old man loving Microsoft technologies and making crazy ideas on business journey.
    SharePoint Vietnam | Blog | Twitter

    Wednesday, October 29, 2014 3:26 AM