Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add support for nginx vhost config drop-ins #367

Merged
merged 1 commit into from
Dec 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/.vscode
/data/nginx/vhost.d/
/data/ssl/
/data/shared/
/workspace/
Expand Down
Empty file added data/nginx/vhost.d/.gitkeep
Empty file.
3 changes: 3 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ services:
volumes:
- /var/run/docker.sock:/tmp/docker.sock:ro
- ./data/ssl/:/etc/nginx/certs
- ./data/nginx/vhost.d/:/etc/nginx/vhost.d
environment:
DHPARAM_BITS: 2048
DHPARAM_GENERATION: "false"
Expand Down Expand Up @@ -58,6 +59,8 @@ services:
- phpmyadmin${DOMAIN_SUFFIX}
- talk-signaling${DOMAIN_SUFFIX}
- talk-recording${DOMAIN_SUFFIX}
extra_hosts:
- host.docker.internal:host-gateway

haproxy:
image: haproxy
Expand Down
19 changes: 19 additions & 0 deletions docs/customizing/nginx.md
Original file line number Diff line number Diff line change
@@ -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;
}
```
Loading