简体   繁体   中英

Use domains in docker image

Is it possible to configure multiple domains in a docker image pointing to localhost? For example, my website has two domains that reflect different languages. Now I would like to use these within a docker image to perform tests. On Windows I would enter this in Windows/System32/drivers/etc/hosts the following:

 127.0.0.1 domain.de 127.0.0.1 domain.com 

I use nginx: alpine as an image. What exactly should I enter in /etc/hosts for this?

Why do you need to touch hosts file? You need to configure nginx for a multi-host site. Maybe you need to modify hosts to your host machine if you want to redirect requests to the container.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM