1
0
mirror of https://github.com/dokku/buildpack-nginx.git synced 2025-12-05 01:25:10 +00:00

28 Commits
v25 ... v27

Author SHA1 Message Date
6c3e8af17f Merge pull request #90 from dokku/fix-sigil-download
fix: properly download sigil
2025-11-21 21:41:03 -05:00
14214785d7 fix: properly download sigil 2025-11-21 21:40:04 -05:00
25571d4189 Merge pull request #88 from dokku/upgrade-sigil
feat: upgrade sigil version from 0.10.1 to 0.11.5
2025-11-21 20:50:38 -05:00
154edf423b feat: upgrade sigil version from 0.10.1 to 0.11.5 2025-11-21 20:48:07 -05:00
087ffbbef2 Merge pull request #87 from dokku/upgrade-zlib
feat: upgrade zlib version from 1.3 to 1.3.1
2025-11-21 20:46:06 -05:00
e5c4e68f8c chore: remove debug mode 2025-11-21 20:44:19 -05:00
fa0e5758a5 debug: set trace to 1 to see what the action is doing on push 2025-11-21 20:20:58 -05:00
c90d35aa9b feat: upgrade zlib version from 1.3 to 1.3.1 2025-11-21 20:15:05 -05:00
23011e35cd Merge pull request #86 from dokku/upgrade-pcre2
feat: upgrade pcre2 version from 10.42 to 10.47
2025-11-21 20:14:04 -05:00
6facd99c18 feat: upgrade pcre2 version from 10.42 to 10.47 2025-11-21 20:08:26 -05:00
29d384b8f5 Merge pull request #85 from dokku/upgrade-nginx
feat: upgrade nginx version from 1.26.2 to 1.29.3
2025-11-21 20:06:51 -05:00
9294ea62ad feat: upgrade nginx version from 1.26.2 to 1.29.3 2025-11-21 19:55:32 -05:00
5b78844e1e Merge pull request #84 from dokku/dependabot/github_actions/actions/checkout-6
chore(deps): bump actions/checkout from 5 to 6
2025-11-21 19:49:32 -05:00
75a9d50394 chore(deps): bump actions/checkout from 5 to 6
Bumps [actions/checkout](https://github.com/actions/checkout) from 5 to 6.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v5...v6)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-11-21 10:13:17 +00:00
05b3a5c841 Merge pull request #83 from dokku/josegonzalez-patch-1
chore: update actions/checkout from v4 to v5
2025-09-03 00:32:46 -04:00
f415d7d80d chore: update actions/checkout from v4 to v5 2025-09-03 00:32:31 -04:00
cf60a30bc8 Merge pull request #82 from dokku/josegonzalez-patch-1
chore: update actions/checkout from v4 to v5
2025-09-03 00:32:20 -04:00
f77b6db3a0 chore: update actions/checkout from v4 to v5 2025-09-03 00:32:05 -04:00
f2bbc7f0a0 Merge pull request #81 from dokku/josegonzalez-patch-1
chore: rename workflow from build to deploy
2025-09-03 00:31:02 -04:00
c1c5ed2d9e chore: rename workflow from build to deploy 2025-09-03 00:30:16 -04:00
806f8f5b0a Merge pull request #79 from hico-horiuchi/master
feat: support nginx custom parameters
2024-09-21 23:16:21 -04:00
4e4c3824c5 feat: support nginx custom parameters 2024-09-21 15:53:09 +09:00
66fb51bbbc Merge pull request #76 from andipabst/nginx-version-and-https
Nginx version 1.26.2 and download nginx via https
2024-09-14 01:35:34 -04:00
b07e670e70 Merge pull request #78 from dokku/dependabot/github_actions/actions/checkout-4
chore(deps): bump actions/checkout from 2 to 4
2024-09-14 01:33:19 -04:00
070d37fe76 chore(deps): bump actions/checkout from 2 to 4
Bumps [actions/checkout](https://github.com/actions/checkout) from 2 to 4.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v2...v4)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-14 05:32:55 +00:00
f90db13abf Merge pull request #77 from dokku/josegonzalez-patch-1
feat: add dependabot support
2024-09-14 01:32:16 -04:00
9e8c05da50 feat: add dependabot support 2024-09-14 01:31:32 -04:00
fe785a5a04 download nginx version 1.26.2 via https 2024-09-03 18:25:13 +02:00
6 changed files with 70 additions and 23 deletions

8
.github/dependabot.yaml vendored Normal file
View File

@ -0,0 +1,8 @@
---
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: daily
open-pull-requests-limit: 10

View File

@ -1,5 +1,5 @@
---
name: 'review-app'
name: 'deploy'
# yamllint disable-line rule:truthy
on:
@ -13,7 +13,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Cloning repo
uses: actions/checkout@v2
uses: actions/checkout@v6
with:
fetch-depth: 0

View File

@ -1,5 +1,5 @@
---
name: 'review-app'
name: "review-app"
# yamllint disable-line rule:truthy
on:
@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Cloning repo
uses: actions/checkout@v2
uses: actions/checkout@v6
with:
fetch-depth: 0
@ -20,9 +20,9 @@ jobs:
with:
# create a review app
command: review-apps:create
git_remote_url: 'ssh://dokku@dokku.com/nginx-buildpack'
git_remote_url: "ssh://dokku@dokku.com/nginx-buildpack"
# specify `--force` as a flag for git pushes
git_push_flags: '--force'
git_push_flags: "--force"
# specify a name for the review app
review_app_name: nginx-buildpack-${{ github.event.pull_request.number }}
ssh_private_key: ${{ secrets.SSH_PRIVATE_KEY }}

View File

@ -30,7 +30,7 @@ You can override the nginx root via setting the `NGINX_ROOT` environment variabl
# where the app is named `static-app`
# and the root dir is _site
dokku config:set static-app NGINX_ROOT=_site
````
```
### Default to index for history routing
@ -42,6 +42,23 @@ By default, this buildpack will 404 if a requested file is not found. For static
dokku config:set static-app NGINX_DEFAULT_REQUEST=index.html
```
### Custom nginx directives
You can configure following nginx directives via environment variables.
- `NGINX_WORKERS` : `worker_processes` directive
- `NGINX_WORKER_CONNECTIONS` : `worker_connections` directive
- `NGINX_CLIENT_BODY_TIMEOUT` : `client_body_timeout` directive
- `NGINX_CLIENT_MAX_BODY_SIZE` : `client_max_body_size` directive (in MB)
```shell
# where the app is named `static-app`
dokku config:set static-app NGINX_WORKERS=4 \
NGINX_WORKER_CONNECTIONS=1024 \
NGINX_CLIENT_BODY_TIMEOUT=5 \
NGINX_CLIENT_MAX_BODY_SIZE=1
```
### Custom nginx config file
You may completely override the built-in nginx config by placing an `app-nginx.conf.sigil` file in the root, modeled after our own [`conf/app-nginx.conf.sigil`](https://github.com/dokku/buildpack-nginx/blob/master/conf/app-nginx.conf.sigil). This will be used inside of the container, and not by the host Dokku instance. See the [sigil project](https://github.com/gliderlabs/sigil) for more information concerning the sigil format.

View File

@ -3,13 +3,16 @@
set -eo pipefail
[[ $TRACE ]] && set -x
NGINX_VERSION="1.25.2"
# https://nginx.org/en/download.html
NGINX_VERSION="1.29.3"
NGINX_TARBALL="nginx-${NGINX_VERSION}.tar.gz"
PCRE_VERSION="10.42"
# https://github.com/PCRE2Project/pcre2/releases
PCRE_VERSION="10.47"
PCRE_TARBALL="pcre2-${PCRE_VERSION}.tar.gz"
SIGIL_VERSION="0.10.1"
SIGIL_TARBALL="gliderlabs-sigil_${SIGIL_VERSION}_linux_amd64.tgz"
ZLIB_VERSION="1.3"
# https://github.com/gliderlabs/sigil/releases
SIGIL_VERSION="0.11.5"
# https://github.com/madler/zlib/releases
ZLIB_VERSION="1.3.1"
ZLIB_TARBALL="zlib-${ZLIB_VERSION}.tar.gz"
suppress() {
@ -51,7 +54,7 @@ cd "$CACHE_DIR"
if [[ ! -d "${NGINX_TARBALL%.tar.gz}" ]]; then
echo "-----> Download and unzip nginx ${NGINX_VERSION} via http"
curl -sSL "http://nginx.org/download/${NGINX_TARBALL}" -o "${NGINX_TARBALL}"
curl -sSL "https://nginx.org/download/${NGINX_TARBALL}" -o "${NGINX_TARBALL}"
tar xzf "${NGINX_TARBALL}" && rm -f "${NGINX_TARBALL}"
fi
@ -67,18 +70,18 @@ if [[ ! -d "${ZLIB_TARBALL%.tar.gz}" ]]; then
tar xzf "${ZLIB_TARBALL}" && rm -rf "${ZLIB_TARBALL}"
fi
if [[ ! -f "gliderlabs-sigil-amd64" ]]; then
mkdir -p "$BUILD_DIR/sigil"
if [[ ! -f "$BUILD_DIR/sigil/sigil-${SIGIL_VERSION}" ]]; then
echo "-----> Download and unzip sigil ${SIGIL_VERSION} via http"
curl -sSL "https://github.com/gliderlabs/sigil/releases/download/v${SIGIL_VERSION}/gliderlabs-sigil_${SIGIL_VERSION}_linux_amd64.tgz" -o "${SIGIL_TARBALL}"
tar xzf "${SIGIL_TARBALL}" && rm -rf "${SIGIL_TARBALL}"
curl -fsSL "https://github.com/gliderlabs/sigil/releases/download/v${SIGIL_VERSION}/sigil-linux-amd64" -o "$BUILD_DIR/sigil/sigil-${SIGIL_VERSION}"
cp "$BUILD_DIR/sigil/sigil-${SIGIL_VERSION}" "$BUILD_DIR/sigil/sigil"
chmod +x "$BUILD_DIR/sigil/sigil"
fi
mkdir -p "$BUILD_DIR/sigil"
if [[ ! -f "gliderlabs-sigil-amd64" ]]; then
echo " ! Missing gliderlabs-sigil-amd64 binary"
if [[ ! -f "$BUILD_DIR/sigil/sigil" ]]; then
echo " ! Missing sigil binary"
exit 1
fi
cp -r gliderlabs-sigil-amd64 "$BUILD_DIR/sigil/sigil"
cd "nginx-${NGINX_VERSION}"
if [[ ! -f "${CACHE_DIR}/bin/nginx" ]]; then
@ -174,7 +177,7 @@ cat <<EOF >"$BUILD_DIR/start_nginx"
#!/usr/bin/env bash
rm -f /app/nginx/nginx.conf
if [[ -f /app/nginx/app-nginx.conf.sigil ]]; then
/app/sigil/sigil -f /app/nginx/app-nginx.conf.sigil NGINX_ROOT="\$NGINX_ROOT" NGINX_DEFAULT_REQUEST="\$NGINX_DEFAULT_REQUEST" PORT="\$PORT" | cat -s > /app/nginx/nginx.conf
/app/sigil/sigil -f /app/nginx/app-nginx.conf.sigil NGINX_ROOT="\$NGINX_ROOT" NGINX_DEFAULT_REQUEST="\$NGINX_DEFAULT_REQUEST" NGINX_WORKERS="\$NGINX_WORKERS" NGINX_WORKER_CONNECTIONS="\$NGINX_WORKER_CONNECTIONS" NGINX_CLIENT_BODY_TIMEOUT="\$NGINX_CLIENT_BODY_TIMEOUT" NGINX_CLIENT_MAX_BODY_SIZE="\$NGINX_CLIENT_MAX_BODY_SIZE" PORT="\$PORT" | cat -s > /app/nginx/nginx.conf
else
erb /app/nginx/nginx.conf.erb > /app/nginx/nginx.conf
fi

View File

@ -1,19 +1,38 @@
worker_processes 1;
{{ if ne $.NGINX_WORKERS "" }}
worker_processes {{ $.NGINX_WORKERS }};
{{ else }}
worker_processes 1;
{{ end }}
error_log stderr;
pid nginx.pid;
daemon off;
events {
worker_connections 768;
{{ if ne $.NGINX_WORKER_CONNECTIONS "" }}
worker_connections {{ $.NGINX_WORKER_CONNECTIONS }};
{{ else }}
worker_connections 768;
{{ end }}
}
http {
{{ if ne $.NGINX_CLIENT_BODY_TIMEOUT "" }}
client_body_timeout {{ $.NGINX_CLIENT_BODY_TIMEOUT }};
{{ else }}
client_body_timeout 5;
{{ end }}
types_hash_max_size 2048;
include mime.types;
charset UTF-8;
server {
listen {{ $.PORT }};
server_name _;
{{ if ne $.NGINX_CLIENT_MAX_BODY_SIZE "" }}
client_max_body_size {{ $.NGINX_CLIENT_MAX_BODY_SIZE }}M;
{{ else }}
client_max_body_size 1M;
{{ end }}
{{ if ne $.NGINX_ROOT "" }}
root /app/www/{{ $.NGINX_ROOT }};
{{ else }}