#!/bin/zsh
CONF=/tmp/light9_nginx.conf
ROOT=`dirname $0`/..
ROOT=${ROOT:a}
bin/python light9/homepage/write_config.py /tmp/light9_nginx_routes.conf && \
cat > $CONF <<EOF
worker_processes 1;
daemon off;
error_log /tmp/light9_homepage.err;
pid /dev/null;
events {
worker_connections 1024;
}
http {
include $ROOT/light9/web/mime.types;
server {
access_log off;
autoindex on;
include "/tmp/light9_nginx_routes.conf";
location / {
proxy_pass http://localhost:8300;
}
}
}
EOF
pnpm vite -c light9/homepage/vite.config.ts &
/usr/sbin/nginx -c $CONF
wait