diff host/nginx_common.sh @ 2136:3ca8f933209d nginx_decoupled

Initial; use ~/.nginx-luan/ as nginx master conf dir instead of trying to detect the system default.
author Violet7
date Mon, 19 Jan 2026 19:47:11 -0800
parents
children 67b504ba388c
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/host/nginx_common.sh	Mon Jan 19 19:47:11 2026 -0800
@@ -0,0 +1,16 @@
+#!/bin/bash
+set -e
+
+export NGINX_ROOT_CONFIG_DIR="$HOME/.nginx-luan"
+export NGINX_ROOT_CONFIG_FILE="$NGINX_ROOT_CONFIG_DIR/nginx.conf"
+export NGINX_SITE_CONFIGS_DIR="$NGINX_ROOT_CONFIG_DIR/sites"
+export NGINX_LOG_DIR="$NGINX_ROOT_CONFIG_DIR/log"
+export NGINX_PID_DIR="$NGINX_ROOT_CONFIG_DIR"
+export NGINX_USER="$(whoami)"
+
+# -p makes this succeed if the path exists on macos
+# on linux, mkdir always suceeds if path exists
+mkdir -p $NGINX_ROOT_CONFIG_DIR
+mkdir -p $NGINX_SITE_CONFIGS_DIR
+mkdir -p $NGINX_LOG_DIR
+mkdir -p $NGINX_PID_DIR