我目前正在尝试使{3}}到S3存储桶中,具体取决于在存储桶中具有回退文件的标头。
这是我的要求:
/
X-Service-Name
test.html
的文件,并且X-Service-Name
= test
,那么我应该渲染该文件index.html
我尝试了很多事情,例如proxy_pass,它看起来并不能用于远程文件。我无法使用try_files进行后备工作(有可能吗?)。 rewrite也不适用于远程文件。
这是我当前的配置:
server {
listen 80 default_server;
server_name _;
root /usr/share/nginx/html;
location = / {
index $http_x_service_name.html index.html;
}
location / {
proxy_pass https://s3-ap-southeast-2.amazonaws.com/mybucket/;
}
}
但是仅当我在/usr/share/nginx/html
中创建与我的服务相对应的空文件时这才是愚蠢的。