Environment Ubuntu 16.04, you can successfully access the nginx container through port 80, the shared directory between the container and the host is ~/web
Currently we want to implement: customize two domain names a.com
and b.com, and request the ~/web/a and ~/web/b directories respectively by accessing these two custom domain names
Please tell me how to set the host hosts and nginx container hosts files, and how to configure the conf file of the nginx container.
The nginx.conf configuration in the container is as follows
server {
listen 80;
server_name a.com;
root /usr/local/nginx/html/a;
index index.html;
}
server {
listen 80;
server_name b.com;
root /usr/local/nginx/html/b;
index index.html;
}
You only need to set up the host machine