nginx服务器块玩得不好-';找不到服务器';
基本安装正在linux mint操作系统上运行。解析“localhost”上的域可确认nginx正在运行 然而,我遇到的问题源于我自己的服务器块的生成。它非常基本:nginx服务器块玩得不好-';找不到服务器';,nginx,configuration,server,directive,Nginx,Configuration,Server,Directive,基本安装正在linux mint操作系统上运行。解析“localhost”上的域可确认nginx正在运行 然而,我遇到的问题源于我自己的服务器块的生成。它非常基本: server { listen 80; listen [::]:80; root /usr/share/nginx/html; index index.html index.htm; # Make site accessible from alias
server {
listen 80;
listen [::]:80;
root /usr/share/nginx/html;
index index.html index.htm;
# Make site accessible from alias.
server_name tokum.com www.tokum.com;
location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ /index.html;
# Uncomment to enable naxsi on this location
# include /etc/nginx/naxsi.rules
}
}
如您所见,我在这个服务器块中为www.tokum.com创建了一个别名。试图在浏览器中解析此url时,我收到一条可爱的“未找到服务器”消息
我的感觉是它围绕着“try_files”功能,但我不能确定为什么
除了我的tokum.com服务器块文件(位于路径/etc/nginx/sites available/tokum.com)之外,没有在服务器上创建其他资源。非常感谢您的帮助。您在DNS中添加了新名称了吗?没有,我不知道如何做这样的事情。我的理解是,初始配置将把传入的请求路由到我的域,我的域在它自己的服务器块中定义,这就是返回index.htmlwhat我的意思是-server_name属性不是dns name>