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

minor
author Violet7
date Mon, 19 Jan 2026 21:06:31 -0800
parents 67b504ba388c
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2136
3ca8f933209d Initial; use ~/.nginx-luan/ as nginx master conf dir instead of trying to detect the system default.
Violet7
parents:
diff changeset
1 #!/bin/bash
3ca8f933209d Initial; use ~/.nginx-luan/ as nginx master conf dir instead of trying to detect the system default.
Violet7
parents:
diff changeset
2 set -e
3ca8f933209d Initial; use ~/.nginx-luan/ as nginx master conf dir instead of trying to detect the system default.
Violet7
parents:
diff changeset
3 . nginx_common.sh
3ca8f933209d Initial; use ~/.nginx-luan/ as nginx master conf dir instead of trying to detect the system default.
Violet7
parents:
diff changeset
4
3ca8f933209d Initial; use ~/.nginx-luan/ as nginx master conf dir instead of trying to detect the system default.
Violet7
parents:
diff changeset
5 # Function to print the line and the command that failed
3ca8f933209d Initial; use ~/.nginx-luan/ as nginx master conf dir instead of trying to detect the system default.
Violet7
parents:
diff changeset
6 error_trap() {
3ca8f933209d Initial; use ~/.nginx-luan/ as nginx master conf dir instead of trying to detect the system default.
Violet7
parents:
diff changeset
7 local exit_code=$?
3ca8f933209d Initial; use ~/.nginx-luan/ as nginx master conf dir instead of trying to detect the system default.
Violet7
parents:
diff changeset
8 echo "Error: Command failed at line $BASH_LINENO with exit code $exit_code"
3ca8f933209d Initial; use ~/.nginx-luan/ as nginx master conf dir instead of trying to detect the system default.
Violet7
parents:
diff changeset
9 exit $exit_code
3ca8f933209d Initial; use ~/.nginx-luan/ as nginx master conf dir instead of trying to detect the system default.
Violet7
parents:
diff changeset
10 }
3ca8f933209d Initial; use ~/.nginx-luan/ as nginx master conf dir instead of trying to detect the system default.
Violet7
parents:
diff changeset
11
3ca8f933209d Initial; use ~/.nginx-luan/ as nginx master conf dir instead of trying to detect the system default.
Violet7
parents:
diff changeset
12 trap error_trap ERR
3ca8f933209d Initial; use ~/.nginx-luan/ as nginx master conf dir instead of trying to detect the system default.
Violet7
parents:
diff changeset
13
3ca8f933209d Initial; use ~/.nginx-luan/ as nginx master conf dir instead of trying to detect the system default.
Violet7
parents:
diff changeset
14 LUANHOST_DIR="$(pwd)"
3ca8f933209d Initial; use ~/.nginx-luan/ as nginx master conf dir instead of trying to detect the system default.
Violet7
parents:
diff changeset
15
3ca8f933209d Initial; use ~/.nginx-luan/ as nginx master conf dir instead of trying to detect the system default.
Violet7
parents:
diff changeset
16 cp startup/nginx/mime.types $NGINX_ROOT_CONFIG_DIR
2137
67b504ba388c don't assume the user's primary group name is the same as their username
Violet7
parents: 2136
diff changeset
17 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
2136
3ca8f933209d Initial; use ~/.nginx-luan/ as nginx master conf dir instead of trying to detect the system default.
Violet7
parents:
diff changeset
18 luan startup/nginx/nginx.conf.luan $LUANHOST_DIR >"$NGINX_SITE_CONFIGS_DIR/luanhost.conf"
3ca8f933209d Initial; use ~/.nginx-luan/ as nginx master conf dir instead of trying to detect the system default.
Violet7
parents:
diff changeset
19
3ca8f933209d Initial; use ~/.nginx-luan/ as nginx master conf dir instead of trying to detect the system default.
Violet7
parents:
diff changeset
20 # DON'T put this in the auto-loaded configs dir (NGINX_SITE_CONFIGS_DIR),
3ca8f933209d Initial; use ~/.nginx-luan/ as nginx master conf dir instead of trying to detect the system default.
Violet7
parents:
diff changeset
21 # it is not meant to be loaded on its own.
3ca8f933209d Initial; use ~/.nginx-luan/ as nginx master conf dir instead of trying to detect the system default.
Violet7
parents:
diff changeset
22 luan startup/nginx/nginx.default.conf.luan $LUANHOST_DIR >"$LUANHOST_DIR/local/luanhost.default.conf"