问题在于除了' / public'路线,没有其他路线可行..例如' / public / test'抛出404错误。我搜索并厌倦了每一个建议,仍然没有解决方案。我也试过下面的链接,它们都不适合我。我使用的是Amazon AMI Linux版本。
Creating new Lumen app on nginx throwing 404 when hiting IP Adress through browser
Laravel routes not found on nginx
这是我的nginx.conf
server {
listen 80;
#listen [::]:80 default_server;
server_name 18....my_ip;
#root /usr/share/nginx/html;
root /var/www/html/dev;
# Load configuration files for the default server block.
include /etc/nginx/default.d/*.conf;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location ~ \.php$ {
try_files $uri $uri/ /index.php?$query_string;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_par