- Dockerfile: multistage build (node -> nginx) - docker-entrypoint.sh: injiziert BACKEND_HOST/PORT zur Laufzeit - nginx.conf: SPA-Routing, config.js no-cache - index.html: laedt /config.js vor dem React-Bundle Usage: docker run -e BACKEND_HOST=rmm.example.com -e BACKEND_PORT=8443 -p 80:80 rmm-frontend
22 lines
546 B
Nginx Configuration File
22 lines
546 B
Nginx Configuration File
server {
|
|
listen 80;
|
|
root /usr/share/nginx/html;
|
|
index index.html;
|
|
|
|
# config.js immer frisch laden (kein Cache — enthält Runtime-Config)
|
|
location = /config.js {
|
|
add_header Cache-Control "no-store";
|
|
}
|
|
|
|
# SPA: alle Routen auf index.html
|
|
location / {
|
|
try_files $uri $uri/ /index.html;
|
|
}
|
|
|
|
# API-Requests an Backend weiterleiten (optional, falls kein reverse proxy davor)
|
|
# location /api/ {
|
|
# proxy_pass https://BACKEND_HOST:BACKEND_PORT;
|
|
# proxy_ssl_verify off;
|
|
# }
|
|
}
|