Skip to main content

fl proxy

When running in “proxy” mode, the fl tool or flexifyio/proxy Docker image accepts S3 requests and re-directs them to one or more clouds/storages, possibly via different API, such as Azure Blob API.

Install on Linux (DEB and RPM), then run fl proxy --help to display the list of proxy options.

Options​

fl proxy [OPTION]...

Additional options are located in this page: Common options

Command line option

Environment variable /

Config file option

Description

--config-file

FLEXIFY_ENGINE_CONFIG_FILE

-

[optional] Path to the proxy configuration file. If defined, all command line and environment variables for options that can be defined in the configuration file will be ignored.

See Using configuration file with fl proxy for details.

--key-id
--secret-key

FLEXIFY_ENGINE_KEY_ID
FLEXIFY_ENGINE_SECRET_KEY

virtualEndpoints.[].credentials.accessKey
virtualEndpoints.[].credentials.secretKey

[optional] HMAC Access Key ID and Secret Key for this endpoint. Proxy’s S3 clients need to use those keys to authenticate requests. If not specified, key will be generated and displayed automatically.

-

-

virtualEndpoints.[].credentials.secretKeyType

[optional] Must be set to SHARED_ACCESS_SIGNATURE if Azure SAS token is specified as secretKeyin the configuration file.

--endpoint

FLEXIFY_ENGINE_ENDPOINT

virtualEndpoints.[].serviceEndpoint

[optional] Proxy’s S3 endpoint DNS hostname that S3 clients will use. It is required to use virtual-style bucket addressing. If not specified, only path-style bucket addressing can be used.

--select-policy

FLEXIFY_ENGINE_SELECT_POLICY

virtualEndpoints.[].selectionPolicy

[optional] Storage selection policy for GET/HEAD object requests (newest / fastest / priority).

Default is newest.

--noput-policy

FLEXIFY_ENGINE_NOPUT_POLICY

virtualEndpoints.[].noputPolicy

[optional] Defines if an object should be deleted from a cloud it is not written to when it’s written to other clouds (KEEP/ REMOVE).

Default is KEEP.

--put-minimum

FLEXIFY_ENGINE_PUT_MINIMUM

virtualEndpoints.[].putMinimum

[optional, experimental] A minimum number of clouds that return success for “put” operations before the success if returned to the proxy’s S3 client.

Default is 0, meaning “all storages”.

--select-break-timeout

FLEXIFY_ENGINE_SELECT_BREAK_TIMEOUT

virtualEndpoints.[].selectionBreakTimeout

[optional] Timeout before breaking connection with non-responding clouds when the fastest
selection policy is used.

--aes256-key-for-key

FLEXIFY_ENGINE_AES256_KEY_FOR_KEY

virtualEndpoints.[].aes256KeyForKey

[optional] A secret key to use when encrypting SSE-C key encoded as part of Azure's multipart upload ID. Required to use multipart upload in Azure with SSE-C.

The value can be generated with openssl rand -base64 32. If left blank, engine will generate unique value. Note that when running multiple engines in a scale set, all engines should have the same key value.

--cloud[1-8]

FLEXIFY_ENGINE_CLOUD[1-8]

virtualEndpoints.[].clous.[].cloud.code

[required if --virtual-bucket is not specified]

Cloud provider code. See providers.json for complete list of supported cloud providers and their codes.

Most commonly used: AWS, AZURE, GOOGLE, ALI, B2_S3, WASABI.

Full list of supported providers and their codes can be found in /etc/flexify/providers.json

--cloud[1-8]-key-id

FLEXIFY_ENGINE_CLOUD[1-8]_KEY_ID

virtualEndpoints.[].clouds.[].cloud.credentials.accessKey

[required if --cloud[x] is specified]

HMAC Access Key ID or Azure Storage account name to use when sending requests to that cloud.

--cloud[1-8]-secret-key

FLEXIFY_ENGINE_CLOUD[1-8]_SECRET_KEY

virtualEndpoints.[].clouds.[].cloud.credentials.secretKey

HMAC Secret Access Key or Azure Storage Account key to use when sending requests to that cloud.

--cloud[1-8]-sas-token

FLEXIFY_ENGINE_CLOUD[1-8]_SAS_TOKEN

virtualEndpoints.[].clouds.[].cloud.credentials.secretKey

Azure SAS signature (can be used instead of Azure Storage Account key).

--cloud[1-8]-session-token

FLEXIFY_ENGINE_CLOUD[1-8]_SESSION_TOKEN

virtualEndpoints.[].clouds.[].cloud.credentials.sessionToken

[optional] AWS STS session token if temporary AWS credentials are used. Only for S3.

--cloud[1-8]-endpoint

FLEXIFY_ENGINE_CLOUD[1-8]_ENDPOINT

virtualEndpoints.[].clouds.[].cloud.customEndpoint

[optional] Custom endpoint to use when connecting to that cloud.

--cloud[1-8]-default-region

FLEXIFY_ENGINE_CLOUD[1-8]_DEFAULT_REGION

virtualEndpoints.[].clouds.[].cloud.customDefaultRegion

[optional] Region of a multi-regional provider to use for multi-bucket requests such as ListBuckets or GetBucketLocation.

--cloud[1-8]-no-ssl

FLEXIFY_ENGINE_CLOUD[1-8]_NO_SSL

virtualEndpoints.[].clouds.[].cloud.useSsl

Defines if unencrypted HTTP or encrypted HTTPS when connecting to that cloud.

--cloud[1-8]-force-path-styl

FLEXIFY_ENGINE_CLOUD[1-8]_FORCE_PART_STYLE

virtualEndpoints.[].clouds.[].cloud.forcePathStyle

Force path-style bucket addressing in requests to that cloud.

-

-

virtualEndpoints.[].clouds.[].cloud.bucketDotEncodeSequence

[optional] Escape sequence to replace dots (.) in bucket names. It might be useful for providers that do not support dots in bucket names.

Default: none/disabled

--cloud[1-8]-noput

FLEXIFY_ENGINE_CLOUD[1-8]_NOPUT

virtualEndpoints.[].clouds.[].noput

Do not store/write new data to that cloud.

--cloud[1-8]-nodelete

FLEXIFY_ENGINE_CLOUD[1-8]_NODELETE

virtualEndpoints.[].clouds.[].nodelete

Do not delete data from that cloud.

--cloud[1-8]-now-bucket-region

FLEXIFY_ENGINE_CLOUD[1-8]_NEW_BUCKET_REGION

virtualEndpoints.[].clouds.[].createNewBucketsIn

[optional] Region to create new buckets in.

--virtual-bucket[1-8]

FLEXIFY_ENGINE_VIRTUAL_BUCKET[1-8]

virtualEndpoints.[].virtualBuckets.[].bucketName

[required if --cloud is not specified]

Name of a virtual bucket.

--virt-bucket[1-8]-cloud[1-8]

FLEXIFY_ENGINE_VIRTUAL_BUCKET[1-8]_CLOUD[1-8]

virtualEndpoints.[].virtualBuckets.[].storages.[].storage.cloud.code

[optional] Code code of a cloud provider that will be attached to the virtual bucket.

--virt-bucket[1-8]-cloud[1-8]-key-id

FLEXIFY_ENGINE_VIRTUAL_BUCKET[1-8]_CLOUD[1-8]_KEY_ID

virtualEndpoints.[].virtualBuckets.[].storages.[].storage.cloud.credentials.accessKey

[required if --virt-bucket[x]-cloud[y] is specified]

HMAC Access Key ID or Azure Storage account name of corresponding virtual bucket attachment.

--virt-bucket[1-8]-cloud[1-8]-secret-key

FLEXIFY_ENGINE_VIRTUAL_BUCKET[1-8]_CLOUD[1-8]_SECRET_KEY

virtualEndpoints.[].virtualBuckets.[].storages.[].storage.cloud.credentials.secretKey

[required if --virt-bucket[x]-cloud[y] is specified]

HMAC Secret Access Key, Azure Storage account key or Azure SAS signature of corresponding virtual bucket attachment.

--virt-bucket[1-8]-cloud[1-8]-session-token

FLEXIFY_ENGINE_VIRTUAL_BUCKET[1-8]_CLOUD[1-8]_SESSION_TOKEN

virtualEndpoints.[].virtualBuckets.[].storages.[].storage.cloud.credentials.sessionToken

[optional] AWS STS session token if temporary AWS credentials are used. Only for S3.

--virt-bucket[1-8]-cloud[1-8]-bucket

FLEXIFY_ENGINE_VIRTUAL_BUCKET[1-8]_CLOUD[1-8]_BUCKET

virtualEndpoints.[].virtualBuckets.[].storages.[].storage.bucket

[required if --virt-bucket[x]-cloud[y] is specified]

Name of the attached bucket/container at the storage provider.

--virt-bucket[1-8]-cloud[1-8]-endpoint

FLEXIFY_ENGINE_VIRTUAL_BUCKET[1-8]_CLOUD[1-8]_ENDPOINT

virtualEndpoints.[].virtualBuckets.[].storages.[].storage.cloud.customEndpoint

[optional] Custom endpoint to use when connecting to corresponding storage provider.

--virt-bucket[1-8]-cloud[1-8]-bucket-region

FLEXIFY_ENGINE_VIRTUAL_BUCKET[1-8]_CLOUD[1-8]_BUCKET_REGION

virtualEndpoints.[].virtualBuckets.[].storages.[].storage.region

[optional] Region to be used in AWS v4 signature for requests to corresponding bucket at the storage provider.

--virt-bucket[1-8]-cloud[1-8]-no-ssl

FLEXIFY_ENGINE_VIRTUAL_BUCKET[1-8]_CLOUD[1-8]_NO_SSL

virtualEndpoints.[].virtualBuckets.[].storages.[].storage.cloud.useSsl

Defines if unencrypted HTTP or encrypted HTTPS is used when connecting to the corresponding storage provider.

--virt-bucket[1-8]-cloud[1-8]-force-path-style

FLEXIFY_ENGINE_VIRTUAL_BUCKET[1-8]_CLOUD[1-8]_FORCE_PATH_STYLE

virtualEndpoints.[].virtualBuckets.[].storages.[].storage.cloud.forcePathStyle

Force path-style bucket addressing in requests to corresponding storage provider.

-

-

virtualEndpoints.[].virtualBuckets.[].storages.[].storage.cloud.bucketDotEncodeSequence

[optional] Escape sequence to replace dots (.) in bucket names.

Default: none/disabled

--virt-bucket[1-8]-cloud[1-8]-noput

FLEXIFY_ENGINE_VIRTUAL_BUCKET[1-8]_CLOUD[1-8]_NOPUT

virtualEndpoints.[].virtualBuckets.[].storages.[].noput

Do not store/write new data to the corresponding storage provider when data is written to the virtual bucket.

--virt-bucket[1-8]-cloud[1-8]-nodelete

FLEXIFY_ENGINE_VIRTUAL_BUCKET[1-8]_CLOUD[1-8]_NODELETE

virtualEndpoints.[].virtualBuckets.[].storages.[].nodelete

Do not delete data from the corresponding storage provider when data is deleted from the virtual bucket.

--port

FLEXIFY_ENGINE_PORT

-

[optional] Port for incoming S3 connections over HTTP. 0 disables undecrypted S3 connection over HTTP.

Default is 80.

--ssl-port

FLEXIFY_ENGINE_SSL_PORT

-

[optional] If --ssl-cert is specified, port for incoming S3 connections over HTTPS.

Default is 443.

--ssl-cert
--ssl-key

FLEXIFY_ENGINE_SSL_CERT
FLEXIFY_ENGINE_SSL_KEY

-

[optional] Endpoint’s SSL certificate (full chain) and private key in PEM format. HTTPS will be disabled if not specified.

--max-in-conns

FLEXIFY_ENGINE_MAX_IN_CONNS

-

[optional] Maximum number of simultaneous incoming connections from S3 client accepted by proxy.

Default: unlimited.

--in-conn-idle-timeout

FLEXIFY_ENGINE_IN_CONN_IDLE_TIMEOUT

-

[optional] Client (incoming) TCP connection idle timeout (in seconds). If no data is sent or received via a connection for the specified duration the connection is closed.

Default is 300 seconds.

--cloud-conn-idle-timeout

FLEXIFY_ENGINE_CLOUD_CONN_IDLE_TIMEOUT

-

[optional] Cloud (outgoing) TCP connection idle timeout (in seconds). If no data is sent to or receives via a connection for the specified duration, the connection is closed.

Default is 300 seconds.

--report-level

FLEXIFY_ENGINE_REPORT_LEVEL

-

Report level for proxy reports. One of ALL, FAILED, NONE (default).

Examples​

S3-Azure Gateway​

This will start S3-Azure gateway proxying S3 requests to Azure Blob Storage.

fl proxy \
--cloud AZURE \
--cloud-key-id <storage account name> \
--cloud-secret-key <storage account key>

or

docker run -p 80:80 -p 443:443 flexifyio/proxy \
--cloud AZURE \
--cloud-key-id <storage account name> \
--cloud-secret-key <storage account key>

Multiple providers​

This command will start proxy with Azure and AWS attached. It will combine containers/buckets and objects from all attached providers, and replicate newly written data to both providers.

fl proxy \
--cloud1 AZURE \
--cloud1-key-id <storage account name> \
--cloud1-secret-key <storage account key> \
--cloud2 AWS \
--cloud2-key-id <access key> \
--cloud2-secret-key <secret key>

Now you can connect to the proxy at port 80 with any S3-compatible application.

Combining Azure containers​

Virtual buckets allow re-mapping bucket or container names or combining contents of multiple buckets/containers under the same bucket name.

fl proxy \
--virtual-bucket1 combined-bucket \
--virtual-bucket1-cloud1 AZURE \
--virtual-bucket1-cloud1-key-id <storage account name> \
--virtual-bucket1-cloud1-secret-key <storage account key> \
--virtual-bucket1-cloud1-bucket container1 \
--virtual-bucket1-cloud2 AZURE \
--virtual-bucket1-cloud2-key-id <storage account name> \
--virtual-bucket1-cloud2-secret-key <storage account key> \
--virtual-bucket1-cloud2-bucket container2

virtual-bucket1-cloud1 and virtual-bucket1-cloud2 providers and accounts can be same or different. You can configure up to eight virtual buckets and attach up to eight provider buckets to each of them.

Docker Compose​

Example of Docker Compose file that starts proxy as S3-Azure gateway:

services:
engine:
image: flexifyio/proxy
ports:
- 80:80
volumes:
- $PWD/logs:/var/log/flexify/engine/
- $PWD/reports:/var/lib/flexify/engine/proxy_reports/
environment:
FLEXIFY_ENGINE_KEY_ID: FlIOBSxrQ8IqP3hkXPdWiF0Z
FLEXIFY_ENGINE_SECRET_KEY: <S3 secret key>
FLEXIFY_ENGINE_CLOUD: AZURE
FLEXIFY_ENGINE_CLOUD_KEY_ID: flexifyeastus
FLEXIFY_ENGINE_CLOUD_SECRET_KEY: <Azure account key>
FLEXIFY_ENGINE_PORT: 80
FLEXIFY_ENGINE_LOG_LEVEL: INFO
restart: unless-stopped

Docker Compose with multiple virtual buckets​

Example of Docker Compose file that starts proxy as S3-Azure gateway combining data from two containers and writing changed only to the first container while second container is effectively read-only.

services:
engine:
image: flexifyio/proxy
ports:
- 80:80
volumes:
- logs:/var/log/flexify/engine/
- reports:/var/lib/flexify/engine/proxy_reports/
environment:
# S3 frontend
FLEXIFY_ENGINE_KEY_ID: FlIOBSxrQ8IqP3hkXPdWiF0Z
FLEXIFY_ENGINE_SECRET_KEY: <S3 secret key>
FLEXIFY_ENGINE_VIRTUAL_BUCKET: combined-bucket
# 1st Azure container
FLEXIFY_ENGINE_VIRTUAL_BUCKET_CLOUD1: AZURE
FLEXIFY_ENGINE_VIRTUAL_BUCKET_CLOUD1_KEY_ID: <Azoure account name>
FLEXIFY_ENGINE_VIRTUAL_BUCKET_CLOUD1_SECRET_KEY: <Azure account key>
FLEXIFY_ENGINE_VIRTUAL_BUCKET_CLOUD1_BUCKET: container1
# 2nd Azure container
FLEXIFY_ENGINE_VIRTUAL_BUCKET_CLOUD2: AZURE
FLEXIFY_ENGINE_VIRTUAL_BUCKET_CLOUD2_KEY_ID: <Azoure account name>
FLEXIFY_ENGINE_VIRTUAL_BUCKET_CLOUD2_SECRET_KEY: <Azure account key>
FLEXIFY_ENGINE_VIRTUAL_BUCKET_CLOUD2_BUCKET: container2
FLEXIFY_ENGINE_VIRTUAL_BUCKET_CLOUD2_NOPUT: true
FLEXIFY_ENGINE_VIRTUAL_BUCKET_CLOUD2_NODELETE: true
restart: unless-stopped

Docker Compose with SSL​

To enable TLS/SSL, specify SSL certificate and private key in PEM format (not the path to a file).

services:
engine:
image: flexifyio/proxy:latest
ports:
- 80:80
- 443:443
volumes:
- logs:/var/log/flexify/engine/
- reports:/var/lib/flexify/engine/proxy_reports/
environment:
FLEXIFY_ENGINE_KEY_ID: FlIOBSxrQ8IqP3hkXPdWiF0Z
FLEXIFY_ENGINE_SECRET_KEY: <S3 secret key>
FLEXIFY_ENGINE_CLOUD: AZURE
FLEXIFY_ENGINE_CLOUD_KEY_ID: flexifyeastus
FLEXIFY_ENGINE_CLOUD_SECRET_KEY: <key>
FLEXIFY_ENGINE_PORT: 80
FLEXIFY_ENGINE_SSL_PORT: 443
FLEXIFY_ENGINE_ENDPOINT: s3.example.com
FLEXIFY_ENGINE_SSL_CERT: |
-----BEGIN CERTIFICATE-----
MIIFCDCCA/CgAwIBA.....
-----END CERTIFICATE-----
-----BEGIN CERTIFICATE-----
MIIFFjCCAv6gAwIBAg....
-----END CERTIFICATE-----
FLEXIFY_ENGINE_SSL_KEY: |
-----BEGIN PRIVATE KEY-----
MIIEugIBADANBgkq.....
-----END PRIVATE KEY-----
FLEXIFY_ENGINE_LOG_LEVEL: INFO
restart: unless-stopped

Kubernetes with SSL​

Here is an example of running S3-Azure proxy on Kubernetes such as AKS:

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: flexify-log-claim
namespace: flexify
spec:
accessModes:
- ReadWriteOnce
storageClassName: default
resources:
requests:
storage: 1Gi
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: flexify-deployment
namespace: flexify
spec:
replicas: 3
selector:
matchLabels:
app: flexify
template:
metadata:
labels:
app: flexify
spec:
containers:
- name: flexify
image: flexifyio/proxy:latest
ports:
- containerPort: 80
- containerPort: 443
env:
- name: FLEXIFY_ENGINE_KEY_ID
value: "FlIOBSxrQ8IqP3hkXPdWiF0Z"
- name: FLEXIFY_ENGINE_SECRET_KEY
value: "<secret>"
- name: FLEXIFY_ENGINE_CLOUD
value: "AZURE"
- name: FLEXIFY_ENGINE_CLOUD_KEY_ID
value: "fleastus"
- name: FLEXIFY_ENGINE_CLOUD_SECRET_KEY
value: "<secret>"
- name: FLEXIFY_ENGINE_PORT
value: "80"
- name: FLEXIFY_ENGINE_SSL_PORT
value: "443"
- name: FLEXIFY_ENGINE_ENDPOINT
value: "s3.example.com"
- name: FLEXIFY_ENGINE_LOG_LEVEL
value: "INFO"
- name: FLEXIFY_ENGINE_SSL_CERT
value: |
-----BEGIN CERTIFICATE-----
xxxxx
-----END CERTIFICATE-----
-----BEGIN CERTIFICATE-----
xxxxx
-----END CERTIFICATE-----
- name: FLEXIFY_ENGINE_SSL_KEY
value: |
-----BEGIN PRIVATE KEY-----
xxxx
-----END PRIVATE KEY-----
volumeMounts:
- mountPath: /var/log/flexify/engine/
name: flexify-log
volumes:
- name: flexify-log
persistentVolumeClaim:
claimName: flexify-log-claim
---
apiVersion: v1
kind: Service
metadata:
name: flexify-service
namespace: flexify
annotations:
service.beta.kubernetes.io/azure-load-balancer-internal: "true"
spec:
type: LoadBalancer
ports:
- port: 443
targetPort: 443
selector:
app: flexify