【发布时间】:2016-09-23 12:33:17
【问题描述】:
所以这是我的事。在 nginx/dokku 上运行了一个 php 应用程序。
我有一个正在重定向图像资产的位置。说:
https://test.rokfor.ch/cdn/dummyimage.com/600x400/000/fff
生成图像,显示在浏览器中。
在 php 脚本中调用相同的资源,例如:
header('X-Accel-Redirect: /cdn/dummyimage.com/600x400/000/fff');
exit(0);
导致内部错误。 Nginx 配置如下:
location ~ ^/cdn/(.*?)/(.*) {
resolver 8.8.8.8;
proxy_set_header HOST $1;
proxy_pass "https://$1/$2?$args";
}
什么可能是潜在的问题?因为我不知道该往哪个方向看。
【问题讨论】:
-
错误日志中有什么内容?
-
我收到了
2016/10/03 12:20:59 [error] 249#0: *47 invalid URL prefix in "https://dummyimage.com/600x400/000/fff。似乎它与 ssl 有某种关系:如果我将位置更改为proxy_pass "http://$1/$2?$args";(没有 https),它似乎可以工作。但这对我没有帮助 - 我需要 https! -
每当我想更改
locationdirective 中的某些内容时,我都会收到nginx: [emerg] unknown directive "proxy_ssl_server_name" in /app/nginx_app.conf:6之类的错误... Nginx 编译为--with-http_ssl_module和1.10 版使用OpenSSL 构建。
标签: php nginx dokku x-accel-redirect