curl - Apache proxy not authenticating correctly against Remote -


we have client's remote server(where don't have access to) serves api. authentication protected outside, white-listed against 1 of our server ip (server-a).

the idea setup proxy in our server-a remote server. it's not accepting requests hoped.

we use curl requests headers pass authentication details. authenticates , runs fine our server-a. not proxy set in server-a.

conf:

loadmodule proxy_module modules/mod_proxy.so loadmodule proxy_http_module modules/mod_proxy_http.so  <virtualhost *:80>  servername  proxy.myserver.com  proxypass     /api/    http://api.remoteserver.com/  .... </virtualhost> 

curl :

curl -v --header "username: username" --header 'password: password' --header "customerguid: 123456789" http://proxy.myserver.com/api/

this curl request runs fine proxy server(server-a), not anywhere else!!

what missing here? looking @ proxy idea little wrong?

solved :

since wasn't sure how remote server configured proxy settings , auth restrictions, have added requestheader set options in config testing , got worked.

changed conf:

<virtualhost *:80>  servername  proxy.myserver.com   requestheader set x-forwarded-for <proxy-server-public-ip>  requestheader set x-forwarded-host servera.myserver.com  requestheader set x-forwarded-server servera.myserver.com   proxypass     /api/    http://api.remoteserver.com/  .... </virtualhost> 


Comments

Popular posts from this blog

ios - MKAnnotationView layer is not of expected type: MKLayer -

ZeroMQ on Windows, with Qt Creator -

unity3d - Unity SceneManager.LoadScene quits application -