我已经将nginx用于laravel项目。当我使用域名时,它会显示主页。但是当我点击任何一个链接时,它都不起作用。并显示404未找到错误。
http://www.myhomepage.com //工作中的http://www.myhomepage.com/about //不工作
我使用了以下配置。
server {
listen 80;
root /var/www/abc-company-website/public;
index index.php index.html index.htm index.nginx-debian.html;
server_name myhomepage.com localhost;
location / {
try_files $uri $uri/ =404;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
}
location ~ /\.ht {
deny all;
}
}

发布于 2019-11-16 14:12:38
您可能希望调整location /块以传递查询字符串,如文档所示:
location / {
try_files $uri $uri/ /index.php?$query_string;
}https://stackoverflow.com/questions/58888041
复制相似问题