Laravel 使用 swoole,nginx 配置问题
如题,laravle 中引入了 swoole 扩展后,在 nginx 文件中按网上一些教程配置了代理,除了首页之外其他路由访问都是 404,有大神帮忙看看要怎么改配置文件吗?
server
{
listen 80 default_server reuseport;
#listen [::]:80 default_server ipv6only=on;
server_name _;
root /home/www/test/example/public;
index index.html index.htm index.php;
location = /index.php {
# Ensure that there is no such file named "not_exists" in your "public" directory.
try_files /not_exists @swoole;
}
location / {
try_files $uri $uri/ @swoole;
}
location @swoole {
set $suffix "";
if ($uri = /index.php) {
set $suffix "/";
}
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass http://127.0.0.1:1215$suffix;
}
}
有用吗