Score:0

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

cn flag

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?

diya avatar
la flag
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
user584018 avatar
cn flag
@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
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.