linux - How to configure nginx custom domain name access in docker?
为情所困
为情所困 2017-05-24 11:35:51
0
1
1069

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;
}
为情所困
为情所困

reply all(1)
世界只因有你

You only need to set up the host machine

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!