2

I have nginx to forward traffic to certain site, example config:

server {
  listen 80;
    server_name *.company.com;
      location /CentOS/7.2.1511/x86_64 {
      proxy_pass http://mirror.centos.org/CentOS/7.2.1511/os/x86_64/;
        }
}

This config is working if nginx has a direct internet connection. But I have to use http proxy server to access to Internet. What is the correct config to use http proxy in this situation.

-1

Almost correct, your proxy_pass directive shouldn't have the URI on it and you should set the hostname.

server {
  listen 80;
  server_name *.company.com;
  location /CentOS/7.2.1511/x86_64 {
    proxy_set_header Host mirror.centos.org;
    proxy_pass http://mirror.centos.org;
  }
}
1
  • 1
    Where is proxy IP (or FQDN) address. ngnix is behind a proxy server. – WhoCares Feb 22 '18 at 12:40

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.