is it possible to change the following in apache or nginx?
http://newweb.com/blabla3?API_key=b2b2b2b2b2b&ID=3142
----> forward it to --->
http://testweb.com/blabla/blabla2?API_key=a1a2a3a4a5a6a7a&ID=3142
where,
ID= it will be same on both.
rest of all will be changed.
Motive: I want to hide the API_key "a1a2a3a4a5a6a7a".
I can reverse proxy the "http://newweb.com/blabla3" part but unable to proxy the key.
Hope Im able to clearify you.
Thanks for your response in advance.
Related
I have a apache server with http2 support and a proxy. When I send a curl request via proxy the http protocol falls back to http1.1, can someone tell me if there is any config changes I need to make or it works that way itself?
I can't find the solution to my request, here is what I want to do :
The HTTPS stream arrives on my server from my client's site (of which I do not have the certificate): https://clientwebsite.com
Afterwards I want to send this HTTPS stream to a website that doesn't accept HTTPS. So I send it in HTTP : http://api-website.com
My problem is... I don't know and I don't find how I can do that with Apache on Centos 7
Could someone help me please ?
I'm very happy with Pound as my reverse HTTPS/HTTP proxy
I setup haproxy as reverse proxy in our organization . we want when the client request for some web site like lenovo or oracle or etc. …the request must be passed through our reverse proxy server .(because our client set our dns server and i defined reverse proxy’s ip as those such domain in our dns server). i using SSL passthrough .but i have some problem in this case.
1- some time haproxy doesnt work fine and have problem to load right certificate.for example when i want to see www.amazon.com haproxy load wrong certificate(SSL_ERROR_BAD_CERT_DOMAIN) so firefox prevent to load website. in this case i have www.intel.com in haproxy config so haproxy getting confused and load www.amazon.com with intel certificate website.
2-I want all sub domain of website like *.oracle.com or *.lenovo.com passed through our reverse proxy so we don’t need to register sub domains of website one by one in haproxy server .
i try with -reg or matching pattern method but all of them need to final destination.
3- some time redirection cant work properly and we facing http to https redirection error .(some time client enter lenovo.com or intel.com (means http requesting).to over come this problem i defined http frontend and redirect all request to https except one hypothetical request by acl . but my issue some time appear.
This is simple done by req_ssl_sni and writing simple acl to forward request but attention to just write single forntend and backend ,because multi frontend and backend cause a confusing in haproxy.
I've been messing with this for two days and can't find the magical combination.
I'm using Magento 2 on CentOS 7 with nginx handling SSL passing off to varnish on port 80 which passes on to apache on 8080 which uses php-fpm. I can get Magento to work with just varnish -> apache -> php-fpm but when I try to introduce nginx in the mix to handle the SSL I get a redirect loop on the entire site. I've found all kinds of suggestions here and other places but nothing seems to fix it.
Does anyone have a good guide or any direction on what to do here? Can post configs if necessary.
Please try by clearing your cookies, most of the time it does fix for me.
Well, it's hard to say anything without seeing the code and what redirect you're getting exactly. But if I would have to bet you're missing an x-forwarded-proto header so PHP assumes you connected with HTTP and sends you to HTTPS. Try this in your Varnish configuration:
sub vcl_recv {
...
set req.http.X-Forwarded-Proto = "https";
...
}
I have successfully installed reverse proxy on Apache. It works like a charm. I'm using it to proxy https request to http. My problem is that I need to forward variable SERVER_HTTPS to my end server, to indicate if person is using ssl connection or just http. I have found one way to do:
Each time I can forward HTTP_X_FORWARDED_PROTO variable and check on end server:
if ($_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https')
$_SERVER['HTTPS']='on';
But this variant is not good for me, because I can't edit the end servers scripts. Lets say that I don't even have access to it. But I know how to check if it is forwarded. So, Generally my question is: Is there any way that I can forward this variable? I have seen one more variant, with Rewrite engine , but it didn't work for me and there is no detailed information. Maybe If I will set my server on Nginx + apache this will send this header variable?
If you can edit the end server configuration, take a look at mod_rpaf RPAF_SetHTTPS option :
https://github.com/gnif/mod_rpaf