summaryrefslogtreecommitdiffhomepage
path: root/pkg/docker/welcome.json
diff options
context:
space:
mode:
authorLiam Crilly <liam.crilly@nginx.com>2023-05-09 22:53:18 +0100
committerLiam Crilly <liam.crilly@nginx.com>2023-05-09 22:53:18 +0100
commitd48180190752201865f41b2cf1e0a6740fa2ea59 (patch)
treea059ed440ffdb84172089d3dc91af9ae03f4b686 /pkg/docker/welcome.json
parent8ab16f71fee9505d4159154179082c0aec03ca4c (diff)
downloadunit-d48180190752201865f41b2cf1e0a6740fa2ea59.tar.gz
unit-d48180190752201865f41b2cf1e0a6740fa2ea59.tar.bz2
Docker: show welcome page on port 80 when entrypoint.d is empty.
The entrypoint script now performs a default configuration when no useful files are found in /docker-entrypoint.d/ The default configuration serves a welcome page in response to all requests, using Markdown unless text/html is sent in the Accept header. This provides a useful 'hello world' experience when running a Unit container for the first time.
Diffstat (limited to 'pkg/docker/welcome.json')
-rw-r--r--pkg/docker/welcome.json25
1 files changed, 25 insertions, 0 deletions
diff --git a/pkg/docker/welcome.json b/pkg/docker/welcome.json
new file mode 100644
index 00000000..2a148da8
--- /dev/null
+++ b/pkg/docker/welcome.json
@@ -0,0 +1,25 @@
+{
+ "listeners": {
+ "*:80": {
+ "pass": "routes"
+ }
+ },
+
+ "routes": [
+ {
+ "match": {
+ "headers": {
+ "accept": "*text/html*"
+ }
+ },
+ "action": {
+ "share": "/usr/share/unit/welcome/welcome.html"
+ }
+ },
+ {
+ "action": {
+ "share": "/usr/share/unit/welcome/welcome.md"
+ }
+ }
+ ]
+}