Skip to content

Commit

Permalink
[bitnami/nginx] Release nginx-1.27.1-debian-12-r5 (#72402)
Browse files Browse the repository at this point in the history
Signed-off-by: Bitnami Bot <[email protected]>
  • Loading branch information
bitnami-bot authored Sep 13, 2024
1 parent 360511e commit d1369a2
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 12 deletions.
4 changes: 2 additions & 2 deletions bitnami/nginx/1.27/debian-12/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ ARG TARGETARCH

LABEL com.vmware.cp.artifact.flavor="sha256:c50c90cfd9d12b445b011e6ad529f1ad3daea45c26d20b00732fae3cd71f6a83" \
org.opencontainers.image.base.name="docker.io/bitnami/minideb:bookworm" \
org.opencontainers.image.created="2024-09-10T06:26:46Z" \
org.opencontainers.image.created="2024-09-13T07:00:10Z" \
org.opencontainers.image.description="Application packaged by Broadcom, Inc." \
org.opencontainers.image.documentation="https://github.com/bitnami/containers/tree/main/bitnami/nginx/README.md" \
org.opencontainers.image.licenses="Apache-2.0" \
org.opencontainers.image.ref.name="1.27.1-debian-12-r4" \
org.opencontainers.image.ref.name="1.27.1-debian-12-r5" \
org.opencontainers.image.source="https://github.com/bitnami/containers/tree/main/bitnami/nginx" \
org.opencontainers.image.title="nginx" \
org.opencontainers.image.vendor="Broadcom, Inc." \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,9 +208,14 @@ nginx_initialize() {
fi
nginx_configure "absolute_redirect" "$(is_boolean_yes "$NGINX_ENABLE_ABSOLUTE_REDIRECT" && echo "on" || echo "off" )"
nginx_configure "port_in_redirect" "$(is_boolean_yes "$NGINX_ENABLE_PORT_IN_REDIRECT" && echo "on" || echo "off" )"
# Stream configuration
if is_boolean_yes "$NGINX_ENABLE_STREAM" && is_file_writable "$NGINX_CONF_FILE"; then
cat >> "$NGINX_CONF_FILE" <<EOF
if is_boolean_yes "$NGINX_ENABLE_STREAM"; then
is_file_writable "$NGINX_CONF_FILE" && cat "${BITNAMI_ROOT_DIR}/scripts/nginx/bitnami-templates/default-stream-block.conf" >> "$NGINX_CONF_FILE"
stream {
include "${NGINX_STREAM_SERVER_BLOCKS_DIR}/*.conf";
}
EOF
fi
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ nginx_env_vars=(
NGINX_HTTP_PORT_NUMBER
NGINX_HTTPS_PORT_NUMBER
NGINX_SKIP_SAMPLE_CERTS
NGINX_ENABLE_STREAM
NGINX_ENABLE_ABSOLUTE_REDIRECT
NGINX_ENABLE_PORT_IN_REDIRECT
NGINX_ENABLE_STREAM
)
for env_var in "${nginx_env_vars[@]}"; do
file_env_var="${env_var}_FILE"
Expand Down Expand Up @@ -77,8 +77,8 @@ export WEB_SERVER_HTTP_PORT_NUMBER="$NGINX_HTTP_PORT_NUMBER"
export NGINX_HTTPS_PORT_NUMBER="${NGINX_HTTPS_PORT_NUMBER:-}"
export WEB_SERVER_HTTPS_PORT_NUMBER="$NGINX_HTTPS_PORT_NUMBER"
export NGINX_SKIP_SAMPLE_CERTS="${NGINX_SKIP_SAMPLE_CERTS:-false}"
export NGINX_ENABLE_STREAM="${NGINX_ENABLE_STREAM:-no}"
export NGINX_ENABLE_ABSOLUTE_REDIRECT="${NGINX_ENABLE_ABSOLUTE_REDIRECT:-no}"
export NGINX_ENABLE_PORT_IN_REDIRECT="${NGINX_ENABLE_PORT_IN_REDIRECT:-no}"
export NGINX_ENABLE_STREAM="${NGINX_ENABLE_STREAM:-no}"

# Custom environment variables may be defined below

This file was deleted.

49 changes: 47 additions & 2 deletions bitnami/nginx/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,6 @@ Access your web server in the browser by navigating to `http://localhost:9000`.
### Adding custom server blocks

The default `nginx.conf` includes server blocks placed in `/opt/bitnami/nginx/conf/server_blocks/`. You can mount a `my_server_block.conf` file containing your custom server block at this location.
Also `/opt/bitnami/nginx/conf/stream_server_blocks/` available for stream server blocks which can be enabled via NGINX_ENABLE_STREAM.

For example, in order add a server block for `www.example.com`:

Expand All @@ -132,7 +131,7 @@ server {
}
```

## Step 2: Mount the configuration as a volume
## Step 2: Mount the server block as a volume

```console
docker run --name nginx \
Expand All @@ -151,6 +150,52 @@ services:
...
```

### Adding custom stream server blocks

Similar to server blocks, you can include server blocks for the [NGINX Stream Core Module](https://nginx.org/en/docs/stream/ngx_stream_core_module.html) mounting them at `/opt/bitnami/nginx/conf/stream_server_blocks/`. In order to do so, it's also necessary to set the `NGINX_ENABLE_STREAM` environment variable to `yes`.

## Step 1: Write your `my_stream_server_block.conf` file with the following content

```nginx
upstream backend {
hash $remote_addr consistent;
server backend1.example.com:12345 weight=5;
server 127.0.0.1:12345 max_fails=3 fail_timeout=30s;
server unix:/tmp/backend3;
}
server {
listen 12345;
proxy_connect_timeout 1s;
proxy_timeout 3s;
proxy_pass backend;
}
```

## Step 2: Mount the stream server block as a volume

```console
docker run --name nginx \
-e NGINX_ENABLE_STREAM=yes \
-v /path/to/my_stream_server_block.conf:/opt/bitnami/nginx/conf/stream_server_blocks/my_stream_server_block.conf:ro \
bitnami/nginx:latest
```

or by modifying the [`docker-compose.yml`](https://github.com/bitnami/containers/blob/main/bitnami/nginx/docker-compose.yml) file present in this repository:

```yaml
services:
nginx:
...
environment:
- NGINX_ENABLE_STREAM=yes
...
volumes:
- /path/to/my_stream_server_block.conf:/opt/bitnami/nginx/conf/stream_server_blocks/my_stream_server_block.conf:ro
...
```

### Using custom SSL certificates

*NOTE:* The steps below assume that you are using a custom domain name and that you have already configured the custom domain name to point to your server.
Expand Down

0 comments on commit d1369a2

Please sign in to comment.