reverse-proxy icon indicating copy to clipboard operation
reverse-proxy copied to clipboard

why reverse proxy 302?

Open lifejoyforpy opened this issue 3 years ago • 6 comments

i in local env , i found my browser is my a.com(this is want),but i pub to the production env, i found 302 ,the browser url is change . can i help me? image my local image

lifejoyforpy avatar Oct 09 '22 08:10 lifejoyforpy

i hope cannot change my url.

lifejoyforpy avatar Oct 09 '22 08:10 lifejoyforpy

Your backend server is generating redirects that bypass the proxy.

The server has to be aware of the fact that it may be running behind a reverse proxy and generate redirects accordingly. That is, it should avoid changing the domain via absolute redirects, and make use of X-Forwarded- headers.

The reason it's issuing a redirect in production and not in your local testing may have to do with which Host header it's observing. By default, YARP will use the destination's host for the header, see https://microsoft.github.io/reverse-proxy/articles/header-guidelines.html#host.

MihaZupan avatar Oct 11 '22 15:10 MihaZupan

Triage: Looks like common problem people run into. We should mention it in YARP troubleshooting section as Common problems. Before the "advanced debugging techniques".

karelz avatar Oct 11 '22 17:10 karelz

i compare my local request header and product header ,i rewriter my production header ,tks.

lifejoyforpy avatar Oct 12 '22 05:10 lifejoyforpy

i compare my local request header and product header ,i rewriter my production header ,tks.

Hello, this issue ocurred, I use YARP 2.0.1. , are you have any idea?

fushiontest avatar Aug 03 '23 14:08 fushiontest

这是来自QQ邮箱的假期自动回复邮件。   您好,我最近正在休假中,无法亲自回复您的邮件。我将在假期结束后,尽快给您回复。

lifejoyforpy avatar Aug 03 '23 14:08 lifejoyforpy