NGINX S3 Gateway
Last updated
Was this helpful?
Last updated
Was this helpful?
Learn how to configure the NGINX S3 Gateway for use with Filebase.
NGINX is open-source web server software that can be used for HTTP caching, load balancing, reverse proxying, and media streaming. NGINX can be used to act as a caching gateway for content stored in a private bucket. By using NGINX, your content isn’t susceptible to public discovery on the Internet, and caching helps you save on your bandwidth charges. Additional benefits include security control, compression and content optimization, and access to internal applications.
To do this, the can be used. This S3 gateway implementation includes the following features:
Support for a single S3 bucket.
Caches content for 1 hour.
Supports NGINX open source and NGINX plus.
Uses GET and HEAD requests only.
Is not configured with SSL/TLS.
Read below to learn how to configure the NGINX S3 Gateway for use with Filebase.
git clone https://github.com/nginxinc/nginx-s3-gateway.git
cd nginx-s3-gateway
This key pair can be found in the F5 Customer Portal if you are a NGINX Plus user, or this key pair can be copied from a certificate generator. This certificate and key pair will need to be named nginx-repo.crt
and nginx-repo.key
respectively.
./plus/etc/ssl/nginx
subdirectory.Using Docker BuildKit is recommended since it supports passing a NGINX Plus license file into the container build. Use the following BuildKit command:
DOCKER_BUILDKIT=1 docker build -f Dockerfile.buildkit.plus -t nginx-plus-s3-gateway --secret id=nginx-crt,src=plus/etc/ssl/nginx/nginx-repo.crt --secret id=nginx-key,src=plus/etc/ssl/nginx/nginx-repo.key --squash .
Alternatively, the container can be built without BuildKit using the following command:
docker build -f Dockerfile.plus -t nginx-plus-s3-gateway .
s3-settings.env
.Enter the following text into this file:
Replace the following values:
S3_BUCKET_NAME: Your Filebase bucket name.
S3_ACCESS_KEY_ID: Your Filebase access key.
S3_SECRET_KEY: Your Filebase secret key.
If using NGINX Open Source, use the command:
docker run -it --env-file ./s3-settings.env -p8080:80 nginxinc/nginx-s3-gateway
If using NGINX Plus, use the command:
docker run -it --env-file ./s3-settings.env -p8080:80 nginx-plus-s3-gateway
http://localhost:8080
.Create configuration files such as gzip_compression.conf
and store them in the ./etc/nginx/conf.d
directory.
Then, add the following lines into your Dockerfile, which will automatically add any files with the .conf extension from the local directory: