0
点赞
收藏
分享

微信扫一扫

docker安装nginx,使用本地配置文件

以前干嘛去了 2022-03-11 阅读 132


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;
}
}



举报

相关推荐

0 条评论