1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
| # 创建配置文件 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
# # 方式一 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;' &
|