Nginx service on a Debian VPS that serves tidal impact GeoJSON files for the Seasight
application. The Seasight FastAPI backend proxies requests to this service via the
GEOJSON_VPS_URL environment variable.
- Debian VPS with root/sudo access
- nginx already installed and running (port 80 is in use)
- GeoJSON files already present at
/home/apps/seasight/impact-layers/shapefiles_v1/
/home/apps/seasight/impact-layers/shapefiles_v1/
├── Regions/
│ └── coastal_lsg.geojson
├── Coastal_Buildings/
│ └── building_alp_*.geojson
├── Coastal_Roads/
│ └── roads_alp_*.geojson
├── Coastal_Landcover/
│ └── latest_alp_*.geojson
└── Flood_Inundation/
└── elevation_nowater_alp_*.geojson
From your local machine (in this directory):
scp -r nginx/ scripts/ systemd/ root@<vps-ip>:/tmp/seasight-layers-setup/ssh root@<vps-ip>
cd /tmp/seasight-layers-setup
bash scripts/setup-vps.shThe script will:
- Verify nginx is installed and the layers directory exists
- Copy
seasight-layers.confto/etc/nginx/sites-available/ - Symlink it to
/etc/nginx/sites-enabled/ - Install
seasight-layers-ctlto/usr/local/bin/ - Install and enable
seasight-layers.service - Test the nginx config
- Reload nginx
# Directory listing (JSON)
curl http://localhost:8080/layers/
# Individual file
curl http://localhost:8080/layers/Regions/coastal_lsg.geojsonSet the GEOJSON_VPS_URL environment variable in the Seasight backend:
GEOJSON_VPS_URL=http://<vps-ip>:8080/layers
The backend endpoints map as follows:
| Backend endpoint | VPS URL |
|---|---|
GET /layers |
http://<vps-ip>:8080/layers/ |
GET /layers/Coastal_Buildings/building_alp_0_50.geojson |
http://<vps-ip>:8080/layers/Coastal_Buildings/building_alp_0_50.geojson |
layers/
├── README.md # This file
├── nginx/
│ └── seasight-layers.conf # nginx server block config
├── scripts/
│ └── setup-vps.sh # Run on VPS to deploy
└── systemd/
├── seasight-layers.service # systemd unit (start/stop/status)
└── seasight-layers-ctl # Control script for the service
systemctl start seasight-layers # Enable site + reload nginx
systemctl stop seasight-layers # Disable site + reload nginx
systemctl status seasight-layers # Check if active
seasight-layers-ctl reload # Reload nginx configWhen a domain is configured for the VPS:
- Point DNS to the VPS IP
- Install certbot:
apt install certbot python3-certbot-nginx - Run:
certbot --nginx -d <domain> - Update
GEOJSON_VPS_URLto usehttps://
- 403 on listing: Check that
/home/apps/seasight/impact-layers/shapefiles_v1/exists and is readable by nginx - Port 8080 already in use: Check
ss -tlnp | grep 8080and stop the conflicting service - nginx won't reload: Run
nginx -tto see the exact config error - CORS errors in browser: Verify the
add_headerdirectives are present in the nginx config