You can fill in the IP address. Either leave it blank or fill it in casually and let this configuration be the default.
nginx is based on server_name 匹配 HTTP 请求头的 host,去决定使用那个 server。host 的值浏览器默认填写域名。如果所有server_name都匹配不到就使用默认的server, so writing this is the most reliable:
server {
listen 80 default_server;
}
If if if nonedefault_server默认的就是第一个server.
There is no need to distinguish when there is only one. Without a domain name, you can only create one on one portserver.
You can fill in the IP address. Either leave it blank or fill it in casually and let this configuration be the default.
nginx is based on
server_name
匹配 HTTP 请求头的 host,去决定使用那个server
。host 的值浏览器默认填写域名。如果所有server_name
都匹配不到就使用默认的server
, so writing this is the most reliable:If if if none
default_server
默认的就是第一个server
.There is no need to distinguish when there is only one. Without a domain name, you can only create one on one port
server
.Are you saying that you haven’t purchased a domain name yet? You can configure hosts to resolve to a fixed server yourself.
# localhost name resolution is handled within DNS itself.
# Server IP your_server_name
Configure vhost in Nginx to the specific parsing server file path:
server{
...
# Your server domain name
server_name your_server_name;
# Your file path
root /data/dev/..../;
...
}
If not, you can adjust the IP first, and then you can add it when you have a domain name