view host/gen_nginx.sh @ 2143:0146b4739434 nginx_decoupled

minor
author Violet7
date Mon, 19 Jan 2026 21:06:31 -0800
parents 67b504ba388c
children
line wrap: on
line source

#!/bin/bash
set -e
. nginx_common.sh

# Function to print the line and the command that failed
error_trap() {
	local exit_code=$?
	echo "Error: Command failed at line $BASH_LINENO with exit code $exit_code"
	exit $exit_code
}

trap error_trap ERR

LUANHOST_DIR="$(pwd)"

cp startup/nginx/mime.types $NGINX_ROOT_CONFIG_DIR
luan startup/nginx/nginx_master.conf.luan $NGINX_ROOT_CONFIG_DIR $NGINX_SITE_CONFIGS_DIR $NGINX_LOG_DIR $NGINX_PID_DIR $NGINX_USER $NGINX_GROUP >$NGINX_ROOT_CONFIG_FILE
luan startup/nginx/nginx.conf.luan $LUANHOST_DIR >"$NGINX_SITE_CONFIGS_DIR/luanhost.conf"

# DON'T put this in the auto-loaded configs dir (NGINX_SITE_CONFIGS_DIR),
# it is not meant to be loaded on its own.
luan startup/nginx/nginx.default.conf.luan $LUANHOST_DIR >"$LUANHOST_DIR/local/luanhost.default.conf"