We are excited to announce that the IIS.NET Forums are moving to the new Microsoft Q&A experience. Learn more >

Reverse Proxy problemRSS

12 replies

Last post Apr 14, 2021 08:49 AM by samwu

  • Reverse Proxy problem

    Mar 31, 2021 02:07 AM|A.T|LINK

    I have configure a reverse proxy in my test web server and do a rewrite rule to app server. However, when I key in my web server hostname it will be show as the app server name not the reverse proxy name. Is there some setting that i need to change, because due to restriction I will not be able to launch the URL using the App Server name.

    Thanks

  • Re: Reverse Proxy problem

    Apr 02, 2021 05:44 AM|samwu|LINK

    Hi A.T,

    A.T

    when I key in my web server hostname it will be show as the app server name not the reverse proxy name.

    Can you show me how did you key in the web service hostname? 

    Best regards,

    Sam

    IIS.NET forums are moving to a new home on Microsoft Q&A, we encourage you to go to Microsoft Q&A for .NET for posting new questions and get involved today. Learn more >
  • Re: Reverse Proxy problem

    Apr 05, 2021 04:09 AM|A.T|LINK

    Hi Sam,

    When I enter the reverse proxy URL address , when I logout from the page it will not show reverse proxy url it show the app server that I rewrite to. Any ideas and changes I can make?

  • Re: Reverse Proxy problem

    Apr 06, 2021 09:32 AM|samwu|LINK

    Hi A.T,

    You can clear the cache and try again.

    If you still can’t solve the problem, please show me how you configure the reverse proxy.

    Best regards,

    Sam

    IIS.NET forums are moving to a new home on Microsoft Q&A, we encourage you to go to Microsoft Q&A for .NET for posting new questions and get involved today. Learn more >
  • Re: Reverse Proxy problem

    Apr 07, 2021 01:54 AM|A.T|LINK

    Hi samwu,

    I have rewritten a Inbound rule for Reverse proxy as follow

    Match URL -> Pattern (.*) -> ignore case -> Action -> Rewrite -> https://App Server /{R:1}

    Outbound rule

    Precondition -> ResponseIsHTml  -> {RESPONSE_CONTENT_TYPE} -> ^text/html

    Match -> A,Form,Img . Matches the pattern -> Regular Expressions -> Pattern -> ^http(s)?//apps server/(.*)

    Action -> Rewrite -> http:{R:1}://ReverseProxy/{R:2}

    It works to run URL but when i try to run one application it keep reroute to the app server instead of the reverse proxy

  • Re: Reverse Proxy problem

    Apr 07, 2021 08:43 AM|samwu|LINK

    Hi A.T,

    A.T

    Precondition -> ResponseIsHTml  -> {RESPONSE_CONTENT_TYPE} -> ^text/html

    Match -> A,Form,Img . Matches the pattern -> Regular Expressions -> Pattern -> ^http(s)?//apps server/(.*)

    Action -> Rewrite -> http:{R:1}://ReverseProxy/{R:2}

    It works to run URL but when i try to run one application it keep reroute to the app server instead of the reverse proxy

    You can refer to this link about how to config reverse proxy with URL rewrite.

    https://docs.microsoft.com/en-us/iis/extensions/url-rewrite-module/reverse-proxy-with-url-rewrite-v2-and-application-request-routing

    Best regards,

    Sam

    IIS.NET forums are moving to a new home on Microsoft Q&A, we encourage you to go to Microsoft Q&A for .NET for posting new questions and get involved today. Learn more >
  • Re: Reverse Proxy problem

    Apr 12, 2021 05:17 AM|A.T|LINK

    Hi samwu,

    Now the reverse proxy keep throwing me 505 error bad gateway. How do I resolve it?

    thanks

  • Re: Reverse Proxy problem

    Apr 12, 2021 08:43 AM|samwu|LINK

    Hi A.T,

    A.T

    Now the reverse proxy keep throwing me 505 error bad gateway. How do I resolve it?

    Can you show me the details of 505 error? The 505 error means that the server can't handle the HTTP version used in the request. And bad gateway is a 502 error, not a 505 error. If it is a 502 error, you can refer to this link for troubleshooting.

    https://docs.microsoft.com/en-us/iis/extensions/troubleshooting-application-request-routing/troubleshooting-502-errors-in-arr

    Best regards,

    Sam

    IIS.NET forums are moving to a new home on Microsoft Q&A, we encourage you to go to Microsoft Q&A for .NET for posting new questions and get involved today. Learn more >
  • Re: Reverse Proxy problem

    Apr 12, 2021 09:56 AM|A.T|LINK

    Hi samwu,

    the error is HTTP Error 502.2 - bad gateway there was a connection  error while trying to route the request 

  • Re: Reverse Proxy problem

    Apr 13, 2021 03:12 AM|samwu|LINK

    Hi A.T,

    A.T

    the error is HTTP Error 502.2 - bad gateway there was a connection  error while trying to route the request 

    Could you please provide your rule and the detailed error snapshot? did you try to run the site on a live server without IIS reverse proxy? make sure you enabled the arr on the live server.

    Best regards,

    Sam

    IIS.NET forums are moving to a new home on Microsoft Q&A, we encourage you to go to Microsoft Q&A for .NET for posting new questions and get involved today. Learn more >
  • Re: Reverse Proxy problem

    Apr 13, 2021 07:05 AM|robertsmithtask|LINK

    I am also facing the same problem. Thank you for putting up this question.

  • Re: Reverse Proxy problem

    Apr 13, 2021 01:33 PM|A.T|LINK

    Hi samwu,

    My arr was enabled and the url rewrite was working all the while. But now when i disable all the rewrite rules it will appear IIS page. No changes was being made previously. Out of sudden it is not working kinda strange problem.

    Thanks

  • Re: Reverse Proxy problem

    Apr 14, 2021 08:49 AM|samwu|LINK

    Hi A.T,

    A.T

    My arr was enabled and the url rewrite was working all the while. But now when i disable all the rewrite rules it will appear IIS page. No changes was being made previously. Out of sudden it is not working kinda strange problem.

    This error may be caused by the rule in your url rewrite. Can you show me your url rewrite rule?

    please post more details information about your requirement.

    Best regards,

    Sam

    IIS.NET forums are moving to a new home on Microsoft Q&A, we encourage you to go to Microsoft Q&A for .NET for posting new questions and get involved today. Learn more >