20 lines
540 B
Nginx Configuration File
20 lines
540 B
Nginx Configuration File
server {
|
|
listen 80;
|
|
server_name _;
|
|
|
|
root /usr/share/nginx/html;
|
|
index index.html;
|
|
|
|
# SPA routing: serve index.html for any non-API, non-asset path.
|
|
location / {
|
|
try_files $uri $uri/ /index.html;
|
|
}
|
|
|
|
# REST API proxy (spec section 4: frontend -> backend over frontend-net).
|
|
location /api/ {
|
|
proxy_pass http://mqtt-backend:8000;
|
|
proxy_set_header Host $host;
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
}
|
|
} |