Home > OS >  Consult a nginx configuration problem, given the great spirit
Consult a nginx configuration problem, given the great spirit

Time:11-18

Docker installed two tomcat container, one is 7080, is a 8080
7080 A project 8080 A has A B engineering
Want to pass the nginx by IP + A/IP + B directly access without port

Excuse me, can realize how to implement it

Nginx. Conf how to configure

Yourself with several times, all is restart after the container is not launched

The small white, just a few days to install nginx, baidu for a long time, has been card here

CodePudding user response:

Docker, fix configuration to commit
The location ^ ~/A/{
Proxy_set_header Host $Host;
Proxy_set_header X - Real - IP $remote_addr;
Proxy_set_header X - Forwarded - For $proxy_add_x_forwarded_for;
Proxy_set_header X - NginX Proxy true;

Proxy_pass http://IP:A/;
}

The location ^ ~/B/{
Proxy_set_header Host $Host;
Proxy_set_header X - Real - IP $remote_addr;
Proxy_set_header X - Forwarded - For $proxy_add_x_forwarded_for;
Proxy_set_header X - NginX Proxy true;

Proxy_pass http://IP:B/;
}
  • Related