Kafkatorio/modules/web-map/docker/nginx.conf
Lazzexus c773b05922 Add a building icon layer to the web map
events-server-web keeps the latest state of every building in memory (read
from the map-chunk-entity topic, like the resource patches) and serves them
per area. The web map draws the icons at their real size onto canvas tiles,
so large bases stay fast, and shows each building's name, status and health
on hover. Ghosts are ignored, and buildings are removed when they're mined.

The icons belong to Wube and the mod authors, so they aren't in the repo.
export_building_icons.py builds them from a Factorio client's
--dump-data/--dump-prototype-locale/--dump-icon-sprites output, and the
web-map nginx serves them from a mounted volume.

Also label single-well oil fields "1 well".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-21 09:52:07 +02:00

47 lines
1.3 KiB
Nginx Configuration File

events {}
http {
include mime.types;
default_type application/octet-stream;
# Sets the path, format, and configuration for a buffered log write
#log_format compression '$remote_addr - $remote_user [$time_local] '
#'"$request" $status $upstream_addr '
#'"$http_referer" "$http_user_agent"';
server {
listen 80;
root /usr/share/nginx/html;
index index.html;
# Docker's internal DNS - resolve the backend lazily, so nginx can start before it
resolver 127.0.0.11 valid=10s;
# building icons, exported from Factorio (see docs/kafkatorio-platform/building-icons)
location /kafkatorio/icons/ {
alias /usr/share/nginx/icons/;
expires 1d;
}
# proxy REST + WebSocket requests to events-server-web, so the map and the API share an origin
location /kafkatorio/ {
set $events_server_web http://events-server-web:80;
proxy_pass $events_server_web;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
proxy_read_timeout 1h;
}
location / {
# First attempt to serve request as file, then
# as directory, then fall back to redirecting to index.html
try_files $uri $uri/ $uri.html /index.html;
include mime.types;
}
}
}