- Notifications
You must be signed in to change notification settings - Fork146
nginx/nginx-s3-gateway
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
This project provides a working configuration of NGINX configured to act asan authenticating and caching gateway for to AWS S3 or another S3 compatibleservice. This allows you to proxy a private S3 bucket without requiring usersto authenticate to it. Within the proxy layer, additional functionality can beconfigured such as:
- Listing the contents of a S3 bucket
- Providing an authentication gateway using an alternative authenticationsystem to S3
- Caching frequently accessed S3 objects for lower latency delivery andprotection against S3 outages
- For internal/micro services that can't authenticate against the S3 API(e.g. don't have libraries available) the gateway can provide a meansto accessing S3 objects without authentication
- Compressing objects (gzip,brotli) from gateway to end user
- Protecting S3 bucket from arbitrary public access and traversal
- Rate limiting S3 objects
- Protecting a S3 bucket with aWAF
- Serving static assets from a S3 bucket alongside a dynamic applicationendpoints all in a single RESTful directory structure
All such functionality can be enabled within a standard NGINX configurationbecause this project is nothing other than NGINX with additional configurationthat allows for proxying S3. It can be used as-is if the predefinedconfiguration is sufficient, or it can serve as a base example for a morecustomized configuration.
If the predefined configuration does not meet your needs, it is best to borrowfrom the patterns in this project and build your own configuration. For example,if you want to enable SSL/TLS and compression in your NGINX S3 gatewayconfiguration, you will need to look at other documentation because thisproject does not enable those features of NGINX.
This project can be run as a stand-alone container or as a Systemd service.Both modes use the same NGINX configuration and are functionally equal in termsfeatures. However, in the case of running as a Systemd service, other servicescan be configured that additional functionality such ascertbotforLet's Encrypt support.
Refer to theGetting Started Guide for how to buildand run the gateway.
common/ contains files used by both NGINX OSS and Plus configurations etc/nginx/include/ awscredentials.js common library to read and write credentials awssig2.js common library to build AWS signature 2 awssig4.js common library to build AWS signature 4 and get a session token s3gateway.js common library to integrate the s3 storage from NGINX OSS and Plus utils.js common library to be reused by all of NJS codebasesdeployments/ contains files used for deployment technologies such as CloudFormationdocs/ contains documentation about the projectexamples/ contains additional `Dockerfile` examples that extend the base configurationjsdoc JSDoc configuration filesoss/ contains files used solely in NGINX OSS configurationsplus/ contains files used solely in NGINX Plus configurationstest/ contains automated tests for validang that the examples workDockerfile.oss Dockerfile that configures NGINX OSS to act as a S3 gatewayDockerfile.plus Dockerfile that builds a NGINX Plus instance that is configured equivelently to NGINX OSS - instance is configured to act as a S3 gateway with NGINX Plus additional features enabledDockerfile.buildkit.plus Dockerfile with the same configuration as Dockerfile.plus, but with support for hiding secrets using Docker's BuildkitDockerfile.latest-njs Dockerfile that inherits from the last build of the gateway and then builds and installs the latest version of njs from sourceDockerfile.unprivileged Dockerfiles that inherits from the last build of the gateway and makes the necessary modifications to allow running the container as a non root, unprivileged user.package.json Node.js package file used only for generating JSDocsettings.example Docker env file examplestandalone_ubuntu_oss_install.sh install script that will install the gateway as a Systemd servicetest.sh test launcher
Refer to theDevelopment Guide for more information aboutextending or testing the gateway.
Please see thecontributing guide for guidelines on how to best contribute to this project.
©F5, Inc. 2020 - 2025
About
NGINX S3 Gateway
Topics
Resources
License
Code of conduct
Security policy
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Releases
Packages0
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.