feat: add public-facing web interface with domain-based routing

Add public-web service with static landing page for client enrollment and device provisioning. Add public-web container to docker-compose with port 8082. Configure nginx reverse proxy with domain-based routing: admin-vpn.nesterovic.cc for admin interface and vpn.nesterovic.cc for public interface. Add proxy headers for X-Real-IP, X-Forwarded-For and X-Forwarded-Proto to both server blocks. Create public-web Dockerfile with nginx serving
This commit is contained in:
2026-03-17 22:09:37 +01:00
parent a67fae5c44
commit 65e74c6832
6 changed files with 213 additions and 1 deletions

View File

@@ -44,11 +44,21 @@ services:
networks:
- control
public-web:
build:
context: ..
dockerfile: public-web/Dockerfile
ports:
- "8082:80"
networks:
- control
reverse-proxy:
image: nginx:1.27-alpine
depends_on:
- backend
- admin-web
- public-web
ports:
- "80:80"
volumes:

View File

@@ -1,6 +1,6 @@
server {
listen 80;
server_name _;
server_name admin-vpn.nesterovic.cc;
location /api/ {
proxy_pass http://backend:8080;
@@ -13,6 +13,29 @@ server {
location / {
proxy_pass http://admin-web:80;
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;
}
}
server {
listen 80;
server_name vpn.nesterovic.cc _;
location /api/ {
proxy_pass http://backend: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-Proto $scheme;
}
location / {
proxy_pass http://public-web:80;
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;
}
}