google-app-engine - NGINX 强制斜线 (GAE)
问题描述
我正在尝试将所有 URL 路由到 Google App Engine(nginx 服务器)中的尾部斜杠
我有一个 Angular-Laravel 5.0 应用程序。默认情况下,我将所有请求路由到位于public/app/
目录中的 index.php,因此我有以下规则
这就是我的nginx-app.conf
样子
location / {
index index.php index.html index.html index.js, index.shtml;
try_files $uri $uri/ /index.php?$query_string;
}
这就是我的app.yaml
样子
runtime: php
env: flex
runtime_config:
document_root: public
这就是我所拥有的app/Http/routes.php
Route::get('/', function () {
return redirect('/app/');
});
我的问题是
当我通过 URL 访问我的网站时,https://project-id.appspot.com/app/
它会将我重定向到,https://project-id.appspot.com/app/#/access/signin
但如果我尝试使用
https://project-id.appspot.com/
https://project-id.appspot.com
https://project-id.appspot.com/app
它正在将我重定向到http://project-id.appspot.com:8080/app/
不 https://project-id.appspot.com/app/
我对此有谷歌并找到了这个答案,但我不知道如何将它与我现有的规则一起使用。
如果有人可以指导我,我将不胜感激。
请注意:我是 nginx 服务器的新手
提前致谢。
解决方案
推荐阅读
- php - 打印时避免在一个表格行中出现分页符
- android - 获取超过 90 天的 crashlytics 报告
- python - TypeError: 不支持的操作数类型 -: 'str' 和 'float' python pandas
- tree - 将子父数据框转换为 Newick 格式
- c# - 如何按场景名称获取场景中的游戏对象列表,但只能获取一次?
- asp.net-mvc - 直接访问时能够查看 PartialView,但不能使用 HTML.Partiaul
- python - 十六进制文件的零填充结尾到特定大小的 Python
- django - 带有 Django 通道的 Websocket 不起作用,连接失败
- bash - 如何在bash中的字符串中找到最后一个带小数的分组数字
- firebase - Firestore + Twitter 克隆:使用子集合与根级集合存储推文?