Reverse_proxy without redirect to original url

1. The problem I’m having:

there is an form (like typeform) which url is https://jinshuju.net/f/HoIGm0?x_field_1=1 how can I reverse_proxy to it without redirect ?

with this config

survey.example.com {
  reverse_proxy jinshuju.net {
     header_up Host {upstream_hostport}
   } 
}

when I open survey.example.com/f/HoIGm0?x_field_1=1 in browser, it will redirect to the original url? is it possible to show page of original url without changing url in the browser location bar?

2. Error messages and/or full log output:

the behavior is not what I want

3. Caddy version:

caddy version
v2.7.5 h1:HoysvZkLcN2xJExEepaFHK92Qgs7xAiCFydN5x5Hs6Q=

4. How I installed and ran Caddy:

a. System environment:

Ubuntu 22.04

See the docs, for proxying to an HTTPS upstream: reverse_proxy (Caddyfile directive) — Caddy Documentation

@francislavoie thanks,

for jinshuju.net, though I still don’t understand why, it works.

reverse_proxy https://jinshuju.net {
     header_up Host {upstream_hostport}
} 

but for feishu forms, https://dagexian.feishu.cn/share/base/form/shrcnbhEcnkUWRevp6vBxitscNc

survey.dagexian.com {
   log
   reverse_proxy https://dagexian.feishu.cn {
     header_up User-Agent "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.5 S
afari/605.1.15"
     # header_up Origin dagexian.feishu.cn
     header_up Host {upstream_hostport}
     # header_down -Location
   }
}

I’ve set the form to anonymous access (fill with no login required).

with head_down -Location setting, open the url in browser, I get the Found link.
without head_down -Location setting, open the url it will redirect to upstream url

I’m not sure I understand what you’re trying to say. What don’t you understand, exactly?

[quote=“dfang, post:3, topic:22371”]

What’s your question, exactly? I don’t follow. Please explain in detail.

I don’t understand what you’re trying to do. Show example requests with curl -v. Show your logs.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.