我的nginx配置有问题。我想在子目录中使用Laravel应用程序,完全是domain.com/alfa。在domain.com是另一个应用程序。现在所有的Laravel路由都在nginx子目录中提供了404。有人可以帮忙找错吗?
我的路径:
这是我的nginx配置:
server
{
listen 80;
server_name domain.com;
root /var/www;
index index.php index.html index.htm;
location / {
}
location /alfa {
root /var/www/alfa_path/public;
index index.php index.html index.htm;
try_files $uri $uri/ /alfa_path/public/index.php?$query_string;
}
location ~ .php$ {
try_files $uri =404;
fastcgi_pass unix:/var/run/www.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include /etc/nginx/fastcgi_params;
}
location /phpmyadmin {
root /usr/share/;
index index.php index.html index.htm;
location ~ ^/phpmyadmin/(.+\.php)$ {
try_files $uri =404;
root /usr/share/;
fastcgi_pass unix:/var/run/www.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include /etc/nginx/fastcgi_params;
}
location ~* ^/phpmyadmin/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ {
root /usr/share/;
}
}
location /phpMyAdmin {
rewrite ^/* /phpmyadmin last;
}
}