Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Normalize location path to avoid multiple forward slashes & fix docs #99

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,9 @@ Dockerfile.buildkit.plus Dockerfile with the same configuration as Docke
with support for hiding secrets using Docker's Buildkit
Dockerfile.latest-njs Dockerfile that inherits from the last build of the gateway and
then builds and installs the latest version of njs from source
Dockerfile.latest-unpriviledged Dockerfiles that inherits from the last build of the gateway and
Dockerfile.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, unpriviledged user.
as a non root, unprivileged user.
settings.example Docker env file example
standalone_ubuntu_oss_install.sh install script that will install the gateway as a Systemd service
test.sh test launcher
Expand Down
7 changes: 7 additions & 0 deletions common/etc/nginx/templates/default.conf.template
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,13 @@ server {
# information that could be used to find an exploit.
server_tokens off;

# Normalize location path. Remove instances of double/multipe forward slashes.
# Disabling merge_slashes is necessary for this feature to work.
# Disabling port redirection to avoid broken URLs in bridged hosts
port_in_redirect off;
merge_slashes off;
rewrite (.*?)//+(.*) $1/$2 redirect;

# Uncomment this for a HTTP header that will let you know the cache status
# of an object.
# add_header X-Cache-Status $upstream_cache_status;
Expand Down
2 changes: 1 addition & 1 deletion docs/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,5 @@ If you invoke the test script with a plus parameter, you will need to add your
NGINX repository keys to the `plus/etc/ssl/nginx` directory

```
$ ./test.sh <nginx type - 'oss', 'latest-njs-oss', 'plus', or 'latest-njs-plus'>
$ ./test.sh <nginx type - 'oss', 'latest-njs-oss', 'unprivileged', 'plus', or 'latest-njs-plus'>
```
6 changes: 3 additions & 3 deletions docs/getting_started.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,15 +148,15 @@ docker run --env-file ./settings --publish 80:80 --name nginx-s3-gateway \
nginx-s3-gateway:oss
```

In the same way, if you want to use NGINX OSS container image as a non-root, unpriviledged user,
In the same way, if you want to use NGINX OSS container image as a non-root, unprivileged user,
you can build it as follows:
```
docker build --file Dockerfile.latest-unpriviledged --tag nginx-s3-gateway --tag nginx-s3-gateway:latest-unpriviledged-oss .
docker build --file Dockerfile.unprivileged --tag nginx-s3-gateway --tag nginx-s3-gateway:unprivileged-oss .
```
And run the image binding the container port 8080 to 80 in the host like:
```
docker run --env-file ./settings --publish 80:8080 --name nginx-s3-gateway \
nginx-s3-gateway:latest-unpriviledged-oss
nginx-s3-gateway:unprivileged-oss
```

### Building the NGINX Plus Container Image
Expand Down