Hi! I’m currently trying to use redirects to proxy to another domain, which ideally would be restricted in some way. I’ve had this working for a while with the secondary site open to the public, but I’m trying to move it to a test site which should not be available publicly.
My netlify.toml looks like this, and works when the second site is fully open:
[[redirects]]
from = "/*"
to = "https://my.otherplace.com/:splat"
status = 200
force = false
The first attempt was with Basic-Auth, so I added this to [[redirects]] in netlify.toml:
headers = { Basic-Auth = "myuser:password" }
I turned off Basic-Auth and tried configuring Apache to allow from our Netlify domain:
order deny,allow
deny from all
allow from mynetlifysite.com
I’ve also tried using a custom header, with headers = { x-from = "netlify" }
in netlify.toml and Apache configured like:
order allow,deny
allow from all
RewriteCond %{HTTP:x-from} !^netlify$ [NC]
RewriteRule ^ - [F]
None of these methods have worked. Another piece that could be causing issues is the fact that the secondary domain will redirect to a particular locale. However, with the second site open to the public, going to mynetlifysite[dot]com/en-US proxies as expected, and this is the behavior I’m trying to replicate (but with the site not publicly accessible). Thanks for any help!