feat: Add support for nginx vhost config drop-ins
Signed-off-by: Jonas <jonas@freesources.org>
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1,4 +1,5 @@
|
|||||||
/.vscode
|
/.vscode
|
||||||
|
/data/nginx/vhost.d/
|
||||||
/data/ssl/
|
/data/ssl/
|
||||||
/data/shared/
|
/data/shared/
|
||||||
/workspace/
|
/workspace/
|
||||||
|
|||||||
0
data/nginx/vhost.d/.gitkeep
Normal file
0
data/nginx/vhost.d/.gitkeep
Normal file
@@ -12,6 +12,7 @@ services:
|
|||||||
volumes:
|
volumes:
|
||||||
- /var/run/docker.sock:/tmp/docker.sock:ro
|
- /var/run/docker.sock:/tmp/docker.sock:ro
|
||||||
- ./data/ssl/:/etc/nginx/certs
|
- ./data/ssl/:/etc/nginx/certs
|
||||||
|
- ./data/nginx/vhost.d/:/etc/nginx/vhost.d
|
||||||
environment:
|
environment:
|
||||||
DHPARAM_BITS: 2048
|
DHPARAM_BITS: 2048
|
||||||
DHPARAM_GENERATION: "false"
|
DHPARAM_GENERATION: "false"
|
||||||
@@ -58,6 +59,8 @@ services:
|
|||||||
- phpmyadmin${DOMAIN_SUFFIX}
|
- phpmyadmin${DOMAIN_SUFFIX}
|
||||||
- talk-signaling${DOMAIN_SUFFIX}
|
- talk-signaling${DOMAIN_SUFFIX}
|
||||||
- talk-recording${DOMAIN_SUFFIX}
|
- talk-recording${DOMAIN_SUFFIX}
|
||||||
|
extra_hosts:
|
||||||
|
- host.docker.internal:host-gateway
|
||||||
|
|
||||||
haproxy:
|
haproxy:
|
||||||
image: haproxy
|
image: haproxy
|
||||||
|
|||||||
19
docs/customizing/nginx.md
Normal file
19
docs/customizing/nginx.md
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
# Customize nginx config
|
||||||
|
|
||||||
|
## Add custom config for a virtualhost config
|
||||||
|
|
||||||
|
Add a config snippet to `data/nginx/vhost.d/<vhost-name>`, it will be included in the respective vhost config automatically.
|
||||||
|
|
||||||
|
For example to redirect all requests to `/apps.*/text` to a `vite serve` process on the docker host, add the following to `data/nginx/vhost.d/nextcloud.local`:
|
||||||
|
|
||||||
|
```
|
||||||
|
location ~* ^/apps.*/text/ {
|
||||||
|
rewrite ^/apps.*/text/(.*) /$1 break;
|
||||||
|
proxy_pass http://host.docker.internal:5173;
|
||||||
|
# fallback to nextcloud server if vite serve doesn't answer
|
||||||
|
error_page 502 = @fallback;
|
||||||
|
}
|
||||||
|
location @fallback {
|
||||||
|
proxy_pass http://nextcloud.local;
|
||||||
|
}
|
||||||
|
```
|
||||||
Reference in New Issue
Block a user