【发布时间】:2019-10-25 07:48:34
【问题描述】:
我想在 example.com/api 等子目录中运行 symfony 应用程序。我的配置有什么问题?我收到 404 没有其他错误
server {
listen 80;
listen [::]:80;
server_name www.example.com example.com;
location /api {
alias /var/www/dev/symfony-server/public/;
try_files $uri index.php$is_args$args;
fastcgi_pass unix:/var/run/php/php7.3-fpm.sock;
fastcgi_split_path_info ^(.+\.php)(/.*)$;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
fastcgi_param DOCUMENT_ROOT $realpath_root;
internal;
}
}
【问题讨论】:
-
你的问题是什么?你有错误吗?你能告诉我们任何错误吗?你期待看到什么?你在看什么?你的问题根本不完整。
-
@killstreet 抱歉,我更新了我的帖子。我只收到 404 没有错误日志
-
你还没有为 nginx 设置根目录来查找你的文件
-
我指定了别名。
标签: php nginx server backend devops