Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fallback to HTTP when no cert is available and letsencrypt is enabled, …
…fixes #35
- Loading branch information
Showing
3 changed files
with
39 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Basic configuration | ||
user nginx; | ||
worker_processes 1; | ||
error_log /dev/stderr info; | ||
pid /var/run/nginx.pid; | ||
|
||
events { | ||
worker_connections 1024; | ||
} | ||
|
||
http { | ||
# Standard HTTP configuration with slight hardening | ||
include /etc/nginx/mime.types; | ||
default_type application/octet-stream; | ||
access_log /dev/stdout; | ||
sendfile on; | ||
keepalive_timeout 65; | ||
server_tokens off; | ||
|
||
server { | ||
listen 80; | ||
|
||
location /.well-known/acme-challenge { | ||
proxy_pass http://admin:8081; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/bin/sh | ||
|
||
if [[ ! -z ENABLE_CERTBOT && ! -f /certs/cert.pem ]]; then | ||
cp /etc/nginx/nginx.conf.fallback /etc/nginx/nginx.conf | ||
fi | ||
|
||
nginx -g 'daemon off;' |