gpt4 book ai didi

laravel - Laravel nginx.conf与官方的Heroku php buildpack?

转载 作者:行者123 更新时间:2023-12-02 06:16:38 35 4
gpt4 key购买 nike

我的项目根目录中的`nginx.conf中有以下内容

location / {
try_files $uri $uri/ /index.php?$query_string;
}

但是,只有在 /路径中有效时,所有其他错误才会出现404错误。

如何使用Nginx使Laravel在heroku上工作?

最佳答案

最终为我工作:
程序文件:

web: vendor/bin/heroku-php-nginx -C nginx.conf public/

nginx.conf
location / {
# try to serve file directly, fallback to rewrite
try_files $uri @rewriteapp;
}

location @rewriteapp {
# rewrite all to app.php
rewrite ^(.*)$ /index.php$1 last;
}

关于laravel - Laravel nginx.conf与官方的Heroku php buildpack?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28956500/

35 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com