ip格式
hostPort:containerPort
安装
docker run --name nginx -p 8090:8080 -v /home/king/nginx/nginx.conf:/etc/nginx/nginx.conf -v /home/king/nginx/log:/var/log/nginx -d nginx
nginx.conf
upstream tomcatserver {
server 172.17.0.1:11000;
}
server {
listen 8080;
listen [::]:8080;
server_name nginx-server;
proxy_set_header Host $host;
# Load configuration files for the default server block.
include /etc/nginx/default.d/*.conf;
error_page 404 /404.html;
location = /404.html {
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
}
# location ~/kqweb/ {
location ~/ {
proxy_pass http://tomcatserver;
}
}