Skip to content

Commit 8f7ac79

Browse files
committed
Remove IMGPROXY_S3_MULTI_REGION docs; Add docs on choosing the AWS region
1 parent 2d2a4b7 commit 8f7ac79

2 files changed

Lines changed: 12 additions & 10 deletions

File tree

docs/configuration/options.mdx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,6 @@ imgproxy can process files from Amazon S3 buckets, but this feature is disabled
460460
* [`IMGPROXY_S3_REGION`]: an S3 buckets region
461461
* [`IMGPROXY_S3_ENDPOINT`]: a custom S3 endpoint to being used by imgproxy
462462
* [`IMGPROXY_S3_ENDPOINT_USE_PATH_STYLE`]: controls how the S3 bucket endpoint is constructed. When `true`, the endpoint will be constructed using the path style (`https://your-endpoint.com/%bucket`). When `false`, the endpoint will be constructed using the virtual host style (`https://%bucket.your-endpoint.com`). Default: `true`
463-
* [`IMGPROXY_S3_MULTI_REGION`]: when `true`, allows using S3 buckets from different regions. Default: `false`
464463
* [`IMGPROXY_S3_USE_DECRYPTION_CLIENT`]: when `true`, enables client-side decryption. Default: `false`
465464
* [`IMGPROXY_S3_ASSUME_ROLE_ARN`]: a custom role to assume
466465
* [`IMGPROXY_S3_ASSUME_ROLE_EXTERNAL_ID`]: the external ID required to assume a custom role

docs/image_sources/amazon_s3.mdx

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,12 @@ imgproxy can process images from S3 buckets. To use this feature, do the followi
88

99
1. Set the `IMGPROXY_USE_S3` environment variable to be `true`.
1010
2. [Set up the necessary credentials](#set-up-credentials) to grant access to your bucket.
11-
3. _(optional)_ Specify the AWS region with `IMGPROXY_S3_REGION` or `AWS_REGION`. Default: `us-west-1`
11+
3. _(optional)_ Specify the [AWS region](#choosing-the-aws-region) with `IMGPROXY_S3_REGION` or `AWS_REGION`. Default: `us-west-1`
1212
4. _(optional)_ Specify the S3 endpoint with `IMGPROXY_S3_ENDPOINT`. You can also set `IMGPROXY_S3_ENDPOINT_USE_PATH_STYLE=false` to use the virtual host style for the endpoint.
13-
5. _(optional)_ Set the `IMGPROXY_S3_MULTI_REGION` environment variable to be `true`.
14-
6. _(optional)_ Set the `IMGPROXY_S3_USE_DECRYPTION_CLIENT` environment variable to `true` if your objects are client-side encrypted.
15-
7. _(optional)_ Specify the AWS IAM Role to Assume with `IMGPROXY_S3_ASSUME_ROLE_ARN`.
16-
8. _(optional)_ Specify the External ID that needs to be passed in along with the AWS IAM Role to Assume with `IMGPROXY_S3_ASSUME_ROLE_EXTERNAL_ID`. This will have no effect if the assume role ARN is not specified.
17-
9. Use `s3://%bucket_name/%file_key` as the source image URL.
13+
5. _(optional)_ Set the `IMGPROXY_S3_USE_DECRYPTION_CLIENT` environment variable to `true` if your objects are client-side encrypted.
14+
6. _(optional)_ Specify the AWS IAM Role to Assume with `IMGPROXY_S3_ASSUME_ROLE_ARN`.
15+
7. _(optional)_ Specify the External ID that needs to be passed in along with the AWS IAM Role to Assume with `IMGPROXY_S3_ASSUME_ROLE_EXTERNAL_ID`. This will have no effect if the assume role ARN is not specified.
16+
8. Use `s3://%bucket_name/%file_key` as the source image URL.
1817

1918
If you need to specify the version of the source object, you can use the query string of the source URL:
2019

@@ -69,11 +68,15 @@ aws_secret_access_key = %secret_access_key
6968

7069
S3 access credentials may be acquired by assuming a role using STS. To do so specify the IAM Role arn with the `IMGPROXY_S3_ASSUME_ROLE_ARN` environment variable. Additionally, if you require an external ID to be passed when assuming a role, specify the `IMGPROXY_S3_ASSUME_ROLE_EXTERNAL_ID` environment variable. This approach still requires you to provide initial AWS credentials by using one of the ways described above. The provided credentials role should allow assuming the role with provided ARN.
7170

72-
## Multi-Region mode
71+
## Choosing the AWS region
7372

74-
By default, imgproxy allows using S3 buckets located in a single region specified with `IMGPROXY_S3_REGION` or `AWS_REGION`. If your buckets are located in different regions, set `IMGPROXY_S3_MULTI_REGION` environment variable to be `true` to enable multi-region mode. In this mode, imgproxy will make an additional request to determine the bucket's region when the bucket is accessed for the first time.
73+
The AWS region specified with the `IMGPROXY_S3_REGION` or `AWS_REGION` environment variable determines the S3 endpoint used by imgproxy for the initial request to the bucket. If AWS reports that the bucket is in a different region, imgproxy will remember this, retry the request, and use the new region for all subsequent requests for this bucket.
7574

76-
In this mode, imgroxy uses a region specified with `IMGPROXY_S3_REGION` or `AWS_REGION` to determine the endpoint to which it should send the bucket's region determination request. Thus, it's a good idea to use one of these variables to specify a region closest to the imgproxy instance.
75+
This allows imgproxy to access buckets in any region. However, the initial request to the bucket in a different region than the one specified in the environment variable may add some latency. Thus, the rule of thumb for the best performance is the following:
76+
77+
* If you are going to use only one bucket, set the region to the one where the bucket is located.
78+
* If your most frequently used buckets are in the same region, set the region to that one.
79+
* If your buckets are spread across multiple regions, set the region to the closest one to your imgproxy instance.
7780

7881
## MinIO
7982

0 commit comments

Comments
 (0)