3

what I'm trying to understand the feasibility is to create a completely transparent system for any client's browser that allows me to visit any destination url using a syntax like:

what I am trying to do is perfectly reported, but no solution provieded here http://mailman.nginx.org/pipermail/nginx/2008-December/008987.html

https://example.com/<uri_to_visit>.

the system has to work as if browser is confgured to use a proxy but I don't want to force users to configure proxy parameter.

I thought to use nginx to proxy the uri requests and then squid to process the request. nginx and squid are on the same server but may also be on different servers. I'm trying to access to any website ( for example ) google.com from any browser using

"https://example.com/service/google.com" 

example.com is managed by one of my nginx web server

Following https://stackoverflow.com/questions/28331813/reverse-proxy-from-nginx-to-squid

nginx config section has been set as follows:

location ~* ^/service/(.*) {  
                                                                                                     
    proxy_pass http://localhost:3128/$1$is_args$args;                                                                                                                                                                
    proxy_set_header X-Real-IP $remote_addr;                                                                                       
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;                                                                   
    proxy_set_header X-Forwarded-Proto $scheme;                                                                                    
    proxy_set_header Request-URI $request_uri;     
    proxy_set_header Host $host;                                                                                
                                                                                                                                   
    proxy_redirect off;                                                                                                            
}      

        

                                                                                                

and squid.conf

http_port 3128 vhost allow-direct

now, when I try to access to https://example.com/service/google.com squid logs report.

I suppose is question regarding proxy_pass but I have made many attempts and have not been able to fix it correctly.

squid.log

TCP_MISS/403 4495 GET http://example.com/google.com - HIER_NONE/- text/html
TCP_MISS/403 4589 GET http://example.com/google.com - ORIGINAL_DST/127.0.0.1 text/html
 
4
  • This approach won't take you far. All URLs returned in the HTML from the origin server refer to original URLs, so once user clicks on a URL, he will bypass the proxy. Jul 14, 2020 at 12:48
  • 1
    There is already proxy software that does this correctly, including rewriting links in documents. Why don't you just use something existing? Jul 14, 2020 at 13:04
  • @MichaelHampton ok plese give me some reference to the software as you say already do this kind of job Jul 17, 2020 at 16:54
  • @MichaelHampton you let this question just starve, i join the question to let us know how ;)
    – djdomi
    May 8, 2023 at 16:31

0

You must log in to answer this question.

Browse other questions tagged .