docker pull nginx
docker run --name nginx -p 80:80 -d nginx
docker cp nginx:/etc/nginx/nginx.conf /root/www/nginx docker cp nginx:/etc/nginx/conf.d /root/www/nginx
conf.d/default.config
location / {
root /usr/share/nginx/html;
index index.html index.htm;
}
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_pass http://ip:8090;
docker rm -f nginx
docker run -d -p 80:80 --name nginx -v /root/www/nginx/nginx.conf:/etc/nginx/nginx.conf -v /root/www/nginx/conf.d:/etc/nginx/conf.d -v /root/www//nginx/logs:/var/log/nginx nginx