I am learning nginx and I have this doubt. Do I need to setup a dns in linux (/etc/resolv.conf) or can I just stay with what nginx uses inside its directive server_name?
You can set nginx to listen to ANY domain pointed to that web server with:
listen 80 default_server;
or you can be specific via server_name
. Check Nginx docs
Setting DNS on the webserver itself does not help much..
Adding the entry in your visitor's PC hosts
file can override a domain name's A record pointer to the one specified by you.
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.