73 lines
2.5 KiB
Plaintext
73 lines
2.5 KiB
Plaintext
# Sample Room - Nginx Config for Docker
|
|
#
|
|
# This config uses docker service names (soleprint, frontend, backend)
|
|
# which resolve within the docker network.
|
|
|
|
# sample.spr.local.ar - frontend with soleprint sidebar
|
|
server {
|
|
listen 80;
|
|
server_name sample.spr.local.ar;
|
|
|
|
# Soleprint routes - sidebar API and assets
|
|
location /spr/ {
|
|
proxy_pass http://soleprint:8000/;
|
|
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;
|
|
}
|
|
|
|
# Backend API (uncomment if your app has a backend)
|
|
# location /api/ {
|
|
# proxy_pass http://backend:8000/api/;
|
|
# 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;
|
|
# }
|
|
|
|
# Frontend with sidebar injection
|
|
location / {
|
|
proxy_pass http://frontend: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;
|
|
proxy_http_version 1.1;
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
proxy_set_header Connection "upgrade";
|
|
proxy_set_header Accept-Encoding "";
|
|
|
|
# Inject sidebar CSS and JS into head
|
|
sub_filter '</head>' '<link rel="stylesheet" href="/spr/sidebar.css"><script src="/spr/sidebar.js" defer></script></head>';
|
|
sub_filter_once off;
|
|
sub_filter_types text/html;
|
|
}
|
|
}
|
|
|
|
# sample.local.ar - frontend without sidebar (direct access)
|
|
server {
|
|
listen 80;
|
|
server_name sample.local.ar;
|
|
|
|
# Backend API (uncomment if your app has a backend)
|
|
# location /api/ {
|
|
# proxy_pass http://backend:8000/api/;
|
|
# 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://frontend: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;
|
|
proxy_http_version 1.1;
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
proxy_set_header Connection "upgrade";
|
|
}
|
|
}
|