Refactor demo URLs and add nginx reverse-proxy configuration

This commit is contained in:
2025-06-07 21:16:50 +02:00
parent f8f88f42f4
commit f080037902
5 changed files with 58 additions and 7 deletions

View File

@@ -65,6 +65,7 @@
# Ensure remote path exists before scp
ssh -p "$PORT" "$DEPLOY_USER@$HOST" "mkdir -p $REMOTE_ENV_PATH"
scp -P "$PORT" docker-compose.yml "$DEPLOY_USER@$HOST:$REMOTE_ENV_PATH/docker-compose.yml"
scp -P "$PORT" nginx.conf "$DEPLOY_USER@$HOST:$REMOTE_ENV_PATH/nginx.conf"
echo "Deploying DEMO on $HOST"
ssh -p "$PORT" "$DEPLOY_USER@$HOST" "

View File

@@ -1,4 +1,12 @@
services:
reverse-proxy:
image: nginx:latest
container_name: demo-nginx-proxy
ports:
- "25700:80"
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf:ro
gateway:
image: registry.boomlab.party/rheinsw/demo-websites/main-website
container_name: main-website
@@ -10,5 +18,5 @@ services:
image: registry.boomlab.party/rheinsw/demo-websites/ld1
container_name: ld1
ports:
- "25601:8080"
- "25601:3000"
restart: on-failure

View File

@@ -1,7 +1,11 @@
import type { NextConfig } from "next";
import type {NextConfig} from "next";
const isProd = process.env.NODE_ENV === 'production';
const nextConfig: NextConfig = {
/* config options here */
output: 'standalone',
basePath: isProd ? '/lawfirm-demos/demo1' : '',
assetPrefix: isProd ? '/lawfirm-demos/demo1' : '',
};
export default nextConfig;

View File

@@ -1,10 +1,14 @@
// Base URL
const BASE_URL = process.env.NEXT_PUBLIC_DEMO_BASE_URL ?? 'http://localhost';
const isProd = process.env.NODE_ENV === 'production';
export const demoCategories = [
{
label: 'Anwaltskanzlei',
items: [
{
name: 'Anwaltskanzlei Demo 1',
url: 'http://localhost:5101',
url: isProd ? '/lawfirm-demos/demo1/' : `${BASE_URL}:25601`,
preview: '/previews/lawfirm-1.png',
description: [
'Modernes Design',
@@ -14,7 +18,7 @@ export const demoCategories = [
},
{
name: 'Anwaltskanzlei Demo 2',
url: 'http://localhost:5101',
url: isProd ? '/lawfirm-demos/demo2/' : `${BASE_URL}:25602`,
preview: '/previews/lawfirm-1.png',
description: [
'Modernes Design',
@@ -30,7 +34,7 @@ export const demoCategories = [
items: [
{
name: 'SaaS Landing Page',
url: 'http://localhost:5201',
url: isProd ? '/lawfirm-demos/demo2/' : `${BASE_URL}:25801`,
preview: '/previews/saas-1.png',
description: [
'Klares und minimales UI',

34
nginx.conf Normal file
View File

@@ -0,0 +1,34 @@
worker_processes 1;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
server {
listen 80;
location / {
proxy_pass http://main-website:3000;
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 /lawfirm-demos/demo1/ {
proxy_pass http://ld1: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;
}
# Add more locations as needed for other demos
}
}