1
0
Fork 0
mirror of https://github.com/demostf/proxy synced 2026-06-03 20:14:07 +02:00

initial commit

This commit is contained in:
Robin Appelman 2018-09-15 18:20:02 +02:00
commit 5fdab87b87
4 changed files with 37 additions and 0 deletions

3
Dockerfile Normal file
View file

@ -0,0 +1,3 @@
FROM staticfloat/nginx-certbot
COPY nginx.conf /
COPY configs.sh /scripts/startup/

13
README.md Normal file
View file

@ -0,0 +1,13 @@
# proxy
SSL reverse proxy for demos.tf
## Usage
start the container with the following env variables
- `TARGET`: the hostname of the target container
- `EMAIL`: the email to use for certbot
- `HOST`: the base host to get the certificates for
Note that `$HOST`, `api.$HOST` and `static.$HOST` need to point to this container

5
configs.sh Executable file
View file

@ -0,0 +1,5 @@
#!/usr/bin/env bash
sed -e "s/\${SOURCE}/$HOST/" -e "s/\${TARGET}/$TARGET/" nginx.conf > /etc/nginx/conf.d/$HOST.conf
sed -e "s/\${SOURCE}/api.$HOST/" -e "s/\${TARGET}/$TARGET/" nginx.conf > /etc/nginx/conf.d/api.$HOST.conf
sed -e "s/\${SOURCE}/static.$HOST/" -e "s/\${TARGET}/$TARGET/" nginx.conf > /etc/nginx/conf.d/static.$HOST.conf

16
nginx.conf Normal file
View file

@ -0,0 +1,16 @@
server {
listen 443 ssl;
server_name ${SOURCE};
ssl_certificate /etc/letsencrypt/live/$HOST/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/$HOST/privkey.pem;
location / {
proxy_pass http://${TARGET};
proxy_set_header Host $host;
proxy_connect_timeout 600;
proxy_send_timeout 600;
proxy_read_timeout 600;
send_timeout 600;
client_max_body_size 100M;
}
}