I have a network env, which has outgoing traffic using proxy only.

I want to create some sort of "unproxying GW" for my specific internal network.

I am okey to use any Linux based solution for this, such as: nginx/apache, haproxy, squid, iptables or any other.


proxy: www-proxy.xxx

my server **with** ability to use proxy:
My server **without** proxy, but able to access any port:

In the end I would like to request: > which would go to http://www.museum/subdir/file over www-proxy.xxx (what is squid, if that matters).

any ideas?

I am trying to use nginx here.

I use following additions to default centos config:

http {
    upstream centos {
        server mirror.centos.org;
    resolver_timeout 5s;
        location / {
            proxy_request_buffering off;
#           proxy_redirect https://;
            proxy_pass http://mirror.centos.org/$uri$is_args$args; # used proxy_pass http://centos$uri$is_args$args;
            proxy_redirect http://www-proxy.xxx:8080/ /;

cat /var/log/nginx/error.log output:

2018/11/27 16:59:51 [error] 47525#0: *1 upstream timed out (110: Connection timed out) while connecting to upstream, client:, server: _, request: "GET /centos-7/7/os/x86_64/ HTTP/1.1", upstream: "", host: ""

And Curl output:

curl -v
* About to connect() to port 80 (#0)
*   Trying
* Connected to ( port 80 (#0)
> GET /centos-7/7/os/x86_64/ HTTP/1.1
> User-Agent: curl/7.29.0
> Host:
> Accept: */*
< HTTP/1.1 504 Gateway Time-out
< Server: nginx/1.12.2
< Date: Tue, 27 Nov 2018 15:57:29 GMT
< Content-Type: text/html
< Content-Length: 3693
< Connection: keep-alive

it looks like as I expect it to be, but now need to redirect nginx request to proxy server. Have had idea on using systemd env variable, but not sure if I set it right or nginx ignores it... Maybe nginx proxy_pass headers variables, but not sure how to... any ideas?

with haproxy I hit a different issue, but still no result achieved: I have haproxy config:

frontend www-proxy
    bind *:80
    log global
    mode http
    use_backend         proxy-squid
    default_backend     proxy-squid

backend proxy-squid
    mode http
    option forwardfor
    option http-server-close
    server seliproxy www-proxy.xxx:8080

Yes, it redirects to proxy, but how to say proxy to fetch data from required url?!

Small update:

App I am trying to use is:

screen -S vm virt-install --name VM --vcpus 4 --memory 4096 --location http://mirror.centos.org/centos-7/7/os/x86_64/ --os-variant rhel7 --network network=mgmtbr,model=virtio --disk vol=LVM-pool/vmvol,device=disk,bus=virtio --virt-type kvm --graphics none --console pty --extra-args "console=ttyS0 ip= nameserver= nameserver= inst.proxy='http://www-proxy.xxx:8080/' inst.cmdline"

I do not want to install GUI to set it up. It fails when trying to get "http://mirror.centos.org/centos-7/7/os/x86_64/LiveOS/squashfs.img", I think in between stage1 and stage2? looks like inst.proxy='http://www-proxy.xxx:8080/' is not set, but I can see IP there...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.