# 创建配置文件
tee /etc/nginx/conf.d/ssh.conf <<-'EOF'
server {
listen 80;
listen [::]:80;
server_name 127.0.0.1 localhost 210.21.48.11;
access_log /var/log/nginx/ssh_access.log main;
location /8888 {
proxy_pass http://127.0.0.1:8888;
}
}
EOF
# 重载nginx配置
nginx -s reload
## 如果没有安装nginx
# 方式一
docker run --network=host -v /etc/nginx/conf.d/ssh.conf:/etc/nginx/conf.d/ssh.conf -i --rm nginx
# 方式二
# 安装nginx(docker安装nginx)
docker run --network=host -it --rm nginx bash
# 执行命令
nohup /docker-entrypoint.sh nginx -g 'daemon off;' &