您好,我正在尝试配置一个 nginx Web 服务器来为来自不同子域的不同框架提供服务。以及在主域上提供站点。例如
- example.com - 服务于主网站
- site1.wp.example.com - 提供一个 wordpress 网站
- site2.ci.example.com - 提供一个 codeigniter 网站
- site3.la.example.com - 服务于 laravel 网站
我遇到的问题是此捕获正在捕获 example.com 地址:
server_name ~^(www\.)?(?<vhost>.+)\.wp\.example\.com$;
这显示在错误日志中
"/var/www//web" existence failed (2: No such file or directory) while logging request,
client: xxx.xxx.xxx.xx,
server: ~(www\.)?(?<vhost>.+)\.wp\.example\.com$,
request: "GET / HTTP/2.0",
upstream: "fastcgi://unix:/run/php/php7.0-fpm.sock",
host: "example.com"
我以为 .+ 意味着你必须匹配 1 个或更多?