add nginx.conf and improve readme

This commit is contained in:
Basti SK 2025-03-27 19:21:59 +01:00
parent 119196a1cc
commit 52489241d7
16 changed files with 162 additions and 4 deletions

View File

@ -1,3 +1,26 @@
# Docker-Compose Library
A collection of docker-compose files for different open-source projects.
Disclaimer: most files are to be understood as "getting started" level. Make sure to think about security whenever you expose some service to the Internet!
## Prerequisites
To run these files you must install docker on your host. Detailed information on how to install docker on your operating system can be found [here](https://docs.docker.com/engine/install/). Additionally `docker-compose` is needed. See how to install it [here](https://docs.docker.com/compose/install/).
## List of compose files
The following compose files can be found in this repository.
- bookstack | [docker-compose.yml](./bookstack/docker-compose.yml) | [Link to project](https://www.bookstackapp.com/)
- dashy | [docker-compose.yml](./bookstack/docker-compose.yml) | [Link to project](https://dashy.to/)
- gitea | [docker-compose.yml](./bookstack/docker-compose.yml) | [Link to project](https://about.gitea.com/)
- grafana | [docker-compose.yml](./bookstack/docker-compose.yml) | [Link to project](https://grafana.com/)
- gramps | [docker-compose.yml](./bookstack/docker-compose.yml) | [Link to project](https://gramps-project.org)
- jenkins | [docker-compose.yml](./bookstack/docker-compose.yml) | [Link to project](https://www.jenkins.io/)
- kanboard | [docker-compose.yml](./bookstack/docker-compose.yml) | [Link to project](https://kanboard.org/)
- keycloak | [docker-compose.yml](./bookstack/docker-compose.yml) | [Link to project](https://www.keycloak.org/)
- mediawiki | [docker-compose.yml](./bookstack/docker-compose.yml) | [Link to project](https://www.mediawiki.org)
- nextcloud | [docker-compose.yml](./bookstack/docker-compose.yml) | [Link to project](https://nextcloud.com/)
- offen | [docker-compose.yml](./bookstack/docker-compose.yml) | [Link to project](https://www.offen.dev/)
## Reverse Proxy
Most docker-compose files are created with having a reverse-proxy infront of them to do SSL termination and subdomain binding. In each directory you will find a `nginx.conf` file for NGINX to use. Please note that this file is not including SSL certificates. To provide SSL automatically I recommend using [certbot](https://certbot.eff.org/)

8
bookstack/nginx.conf Normal file
View File

@ -0,0 +1,8 @@
server {
server_name sudomain.your.domain;
location / {
proxy_pass http://127.0.0.1:6875;
}
listen 80;
}

View File

@ -8,7 +8,7 @@ services:
volumes:
- ./config.yml:/app/public/conf.yml
ports:
- 80:80
- 8000:80
environment:
- NODE_ENV=production
- UID=1000

8
dashy/nginx.conf Normal file
View File

@ -0,0 +1,8 @@
server {
server_name sudomain.your.domain;
location / {
proxy_pass http://127.0.0.1:8000;
}
listen 80;
}

9
gitea/nginx.conf Normal file
View File

@ -0,0 +1,9 @@
server {
server_name sudomain.your.domain;
client_max_body_size 15M;
location / {
proxy_pass http://127.0.0.1:3000;
}
listen 80;
}

22
grafana/nginx.conf Normal file
View File

@ -0,0 +1,22 @@
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
server {
server_name sudomain.your.domain;
location / {
proxy_pass http://localhost:3000/;
}
# Proxy Grafana Live WebSocket connections.
location /api/live {
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_set_header Host $http_host;
proxy_pass http://localhost:3002/;
}
listen 80;
}

9
gramps/nginx.conf Normal file
View File

@ -0,0 +1,9 @@
server {
server_name sudomain.your.domain;
client_max_body_size 15M;
location / {
proxy_pass http://127.0.0.1:5000;
}
listen 80;
}

8
jenkins/nginx.conf Normal file
View File

@ -0,0 +1,8 @@
server {
server_name sudomain.your.domain;
location / {
proxy_pass http://127.0.0.1:8080;
}
listen 80;
}

View File

@ -4,7 +4,7 @@ services:
restart: always
image: kanboard/kanboard:latest
ports:
- "80:80"
- "8080:80"
volumes:
- ./data:/var/www/app/data
- ./plugins:/var/www/app/plugins

8
kanboard/nginx.conf Normal file
View File

@ -0,0 +1,8 @@
server {
server_name sudomain.your.domain;
location / {
proxy_pass http://127.0.0.1:8080;
}
listen 80;
}

17
keycloak/nginx.conf Normal file
View File

@ -0,0 +1,17 @@
server {
server_name sudomain.your.domain;
client_max_body_size 15M;
location / {
proxy_pass http://127.0.0.1:8080/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $server_name;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-Port $server_port;
proxy_set_header X-Forwarded-Proto $scheme;
}
listen 80;
}

View File

@ -4,7 +4,7 @@ services:
image: mediawiki
restart: always
ports:
- 80:80
- 8080:80
links:
- database
volumes:

8
mediawiki/nginx.conf Normal file
View File

@ -0,0 +1,8 @@
server {
server_name sudomain.your.domain;
location / {
proxy_pass http://127.0.0.1:8080;
}
listen 80;
}

View File

@ -5,7 +5,7 @@ services:
image: nextcloud:production
restart: always
ports:
- 80:80
- 8080:80
volumes:
- /data:/data:rw
- ./data:/var/www/html

30
nextcloud/nginx.conf Normal file
View File

@ -0,0 +1,30 @@
server {
server_name sudomain.your.domain;
client_max_body_size 0;
# proxy_buffering off;
location / {
proxy_pass http://localhost:8080/; # set this to the nextcloud port set in doccker-compose file
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
client_max_body_size 0;
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains; preload";
#access_log /var/log/nginx/nextcloud.access.log;
#error_log /var/log/nginx/nextcloud.error.log;
}
location = /.well-known/carddav {
return 301 $scheme://$host/remote.php/dav;
}
location = /.well-known/caldav {
return 301 $scheme://$host/remote.php/dav;
}
listen 80;
}

8
offen/nginx.conf Normal file
View File

@ -0,0 +1,8 @@
server {
server_name sudomain.your.domain;
location / {
proxy_pass http://127.0.0.1:8102;
}
listen 80;
}