0

I am new to Apache Httpd server and trying to configure the reverse proxy for an external site and below is my configuration:

SSLProxyEngine on
RewriteEngine on
ProxyPassMatch ^/(.*)$ https://abc.xyz.com/$1
ProxyPassReverse ^/(.*)$ https://abc.xyz.com/$1
RewriteRule /login-callback https://abc.xyz.com/login-callback"

When I an running httpd.exe and in browser when I am trying to browse http://localhost I can successfully proxy to the landing page of external site https://abc.xyz.com.

Now in landing page I have login button which will redirecting it to other site correctly but in redirect_uri it's appending http://localhost/login-callback like below,

https://PQR.xyz.com/oauth2/auth?client_id=my-client-id&code_challenge=lVv_PrQDR_m4Trw5ocYk5zaauGZZGU6EsIgJdmCOe20&code_challenge_method=S256&redirect_uri=http://localhost/login-callback&response_type=code

whereas It's should be https://abc.xyz.com/login-callback

Question: How can I persist the redirect_uri with https://abc.xyz.com/ instead of http://localhost?

user584018
  • 123
  • 5
  • 1
    That depends on how/where the `redirect_uri` actually gets set. When it get set serverside on `https://abc.xyz.com` [this answer](https://serverfault.com/a/561897/984089) may offer an approach - when it gets set on `https://PQR.xyz.com` based on a referrer header or by your client with for example a bit of java script a different approach may be needed. - But getting your development environment up and working is not considered topical for ServerFault – diya Dec 15 '22 at 17:38
  • @diya, Thanks for your comment. I was able to fix this issue, but ran into other issue where I need to configure 2 sites in reverse proxy, could you please give some advise on this question please, https://serverfault.com/questions/1118133/reverse-proxy-issue-with-secondary-site – user584018 Dec 16 '22 at 03:23

0 Answers0