Closed thindrs closed 1 year ago
And just to add, have gone through other related issues, and tried the proxy_pass solutions suggested there. proxy_pass
to another nginx for example serves GET /libstdc++-docs.x86_64.rpm HTTP/1.0
correctly. However above problem happens when using aws_sign.
Example below config fetches the package fine from another nginx on the same machine:
location = /libstdc++-docs.x86_64.rpm {
proxy_pass http://127.0.0.1:8081;
}
For others facing similar problem, here is a workaround fix. Basically a combination this post and making sure the client that sends the request is already encoding the request.
Added following to the nginx conf:
location /test-repo {
aws_sign;
proxy_pass http://BUCKET_NAME.s3.amazonaws.com;
}
location /v1/ {
rewrite ^ $request_uri;
rewrite /v1/(.*) /test-repo/$1 break;
return 400;
proxy_pass http://127.0.0.1:8082$uri;
}
make sure client encodes the request:
curl -v "http://172.19.24.58:8082/v1/hello-c%2B%2B-0.0.1-1.amzn2int.x86_64.rpm"
curl -v "http://172.19.24.58:8082/v1/hello-c++-0.0.1-1.amzn2int.x86_64.rpm"
Workaround fix shared above.
Details
Good day.
Noticing the SignatureDoesNotMatch issue when accessing a S3 key with special character '+' in it. Able to repro the issue consistently. S3 keys that do not have '+' special character work fine.
Steps to Repro:
nginx.conf
Versions
Nginx Logs
Help much appreciated. Thanks in advance.