Mercurial Hosting > luan
annotate host/gen_nginx.sh @ 2146:2bc779c2451d nginx_decoupled
rename files
| author | Violet7 |
|---|---|
| date | Wed, 21 Jan 2026 20:15:11 -0800 |
| parents | 67b504ba388c |
| children | 515e892cd4c2 |
| 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 |
| 2146 | 18 luan startup/nginx/luanhost_controller.conf.luan $LUANHOST_DIR >"$NGINX_SITE_CONFIGS_DIR/luanhost_controller.conf" |
|
2136
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), |
| 2146 | 21 # it is only meant to be loaded as part of a server block. |
| 22 luan startup/nginx/luanhost_default_site.conf.luan $LUANHOST_DIR >"$LUANHOST_DIR/local/luanhost_default_site.conf" |
