在Windows 10 wsl上运行的Nginx,带有虚拟主机can’;联系不到
所以我决定在Windows10上用WSL安装Ubuntu20。默认情况下,我删除了Apache并将其设置为默认nginx。当我尝试从我的Windows访问在Windows 10 wsl上运行的Nginx,带有虚拟主机can’;联系不到,nginx,virtual-machine,virtualhost,windows-subsystem-for-linux,Nginx,Virtual Machine,Virtualhost,Windows Subsystem For Linux,所以我决定在Windows10上用WSL安装Ubuntu20。默认情况下,我删除了Apache并将其设置为默认nginx。当我尝试从我的Windows访问localhost时,我会得到nginx默认页面(它工作正常)。但在我的虚拟机上,我添加了一个无法从Windows机器打开的虚拟主机。当我尝试访问添加到虚拟机的hosts文件和Windows的hosts文件中的服务器名称时,我无法访问 这是我的虚拟主机配置文件 server { listen 80; listen [::]:80
localhost
时,我会得到nginx默认页面(它工作正常)。但在我的虚拟机上,我添加了一个无法从Windows机器打开的虚拟主机。当我尝试访问添加到虚拟机的hosts文件和Windows的hosts文件中的服务器名称时,我无法访问
这是我的虚拟主机配置文件
server {
listen 80;
listen [::]:80;
server_name admin.finestgreens.local www.admin.finestgreens.local;
root /home/melomancheto/www/shop-admin/public;
index index.php index.html index.htm index.nginx-debian.html;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php7.4-fpm.sock;
}
}
我已经检查了fpm路径,以及.sock
文件是否存在,它是否存在。我在站点中有以下配置可用
这是我的网站中启用的符号链接
我已经检查过了,我的nginx
运行正常,我的php-fpm
也运行正常
这是我在Linux和Windows机器上的主机文件
我错过了一些东西,但我不知道是什么
This site can’t be reachedCheck if there is a typo in admin.finestgreens.local.
If spelling is correct, try running Windows Network Diagnostics.
DNS_PROBE_FINISHED_NXDOMAIN
这是我尝试访问我的服务器\u name
时遇到的错误
问题解决了,我的url xD中有一个输入错误