【发布时间】:2020-12-31 23:21:41
【问题描述】:
我的服务器机器上有两个不同的 laravel 应用程序。
它们位于:
D:/APPLICATION/application1
和
D:/APPLICATION/application2
以下是我的nginx.conf内容:
server {
listen 80;
server_name localhost;
location / {
root "D:/APPLICATION/application1/public";
try_files $uri $uri/ /index.php?$query_string;
index index.php index.html index.htm;
location ~ \.php$ {
try_files $uri /index.php = 404;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
location ^~ /application2 {
alias "D:/APPLICATION/application2/public";
try_files $uri $uri/ /index.php?$query_string;
index index.php index.html index.htm;
location ~ \.php$ {
try_files $uri /index.php = 404;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
}
如果我浏览 http://x.x.x.x/,我的第一个 laravel web 应用程序就完美了。
但如果我浏览 http://x.x.x.x/application2 我有 No input file specified.
我在这里缺少什么?
【问题讨论】:
-
更好地使用laragon.org 进行开发
-
对于两个 url,我在 nginx 中使用了 1 个配置文件,而不是在与特定端口和服务器名称的 nginx 列表相同的文件中
-
所以你想要动态的。?