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.

WhoCares
  • 171
  • 1
  • 6

1 Answers1

-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;
  }
}
HostFission
  • 347
  • 1
  • 7