[squid-users] Insert requested URL to custom header in request

Alex Rousskov rousskov at measurement-factory.com
Tue Jun 27 20:43:27 UTC 2023


On 6/27/23 00:37, Alexeyяр Gruzdov wrote:
> Hello again !
> Thanks your help !
> 
> I think one more question:
> 
> 
> Like you can know I have the run app and it’s available by
> 
> curl -H “X-my-header:https://example.com <https://example.com/>” 
> http://127.0.0.1:8089 <http://127.0.0.1:8089/send>
> 
> that means  I say to my app to go to url that put in header and I get 
> the correct answer.
> 
> But I need to use a squid at front of this app. And I added cache_peer 
> as this my internal app and used option request_header_add - and this 
> chain works well, but for http only.
> And doesn’t for https. Because for https uses TCP Connect from squid to 
> requested url, but my app doesn’t support Connect method and just drops 
> incoming.
> is there some way to force squid to make something like regular get / 
> post request for https ( or may be just forward or bypass), or just I 
> will need to add the http proxy support to my app ?

If you configure your cache_peer with an originserver flag, Squid will 
treat that cache peer as an origin server and, hence, will not try to 
open a CONNECT tunnel through it.

Alex.


> On Tue, 20 Jun 2023 at 09:35, Alexeyяр Gruzdov <my.shellac at gmail.com 
> <mailto:my.shellac at gmail.com>> wrote:
> 
>     Hello all !
> 
>     I have web app on the server listens on port 8089. This app
>     processes the Get or Post requests, and also checks if there is
>     specific header in request. For example if I will do on the server
>     request like:
> 
>     curl -H “X-my special header:https://example.com
>     <https://example.com>” http://127.0.0.1:8089/send
>     <http://127.0.0.1:8089/send>
> 
>     I will get it working properly I will get answer from example.com
>     <http://example.com> over my application
> 
>     A questions:
> 
>     1. How I can to add the specific header to request with put the
>     value of this header like requested URL ??? Something like “X-my
>     special header: <requested url>
> 
>     2. How I could to put the cache peer host as  originserver option as
>     url ?  Something like
> 
>     http://127.0.0.1:8089/send <http://127.0.0.1:8089/send>
> 
> 
> 
> _______________________________________________
> squid-users mailing list
> squid-users at lists.squid-cache.org
> http://lists.squid-cache.org/listinfo/squid-users



More information about the squid-users mailing list