【发布时间】:2013-09-05 03:38:03
【问题描述】:
我在 nginx 中使用 Procfile 进行男性 nginx 自定义配置 所以我用这个代码创建了一个名为 Procfile 的新文件
web: vendor/bin/heroku-php-nginx -C nginx_app.conf
和带有此代码的 nginx_app.conf 的新文件
location / {
# try to serve file directly, fallback to rewrite
try_files $uri @rewriteapp;
}
location @rewriteapp {
# rewrite all to app.php
rewrite ^(.*)$ /app.php/$1 last;
}
location ~ ^/(app|app_dev|config)\.php(/|$) {
fastcgi_pass heroku-fcgi;
fastcgi_split_path_info ^(.+\.php)(/.*)$;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param HTTPS off;
}
所以在我的 heroku 应用程序目录中有两个文件夹作为 yii(yii 框架支持文件),第二个是文档根文件夹,我的应用程序在哪里,所以我现在想要两个,我们必须在 nginx_app.conf 文件中声明文档根目录
【问题讨论】: