From c748d7e9607f443ffe8f736e279728a15c078a6b Mon Sep 17 00:00:00 2001 From: Daniel Micay Date: Sat, 15 Jul 2023 16:34:24 -0400 Subject: [PATCH] simplify nginx configuration deployment --- deploy-static | 6 ++---- nginx/nginx.conf | 2 +- nginx/root_grapheneos.org.conf | 2 ++ 3 files changed, 5 insertions(+), 5 deletions(-) create mode 100644 nginx/root_grapheneos.org.conf diff --git a/deploy-static b/deploy-static index 518222cc..ce96e6ac 100755 --- a/deploy-static +++ b/deploy-static @@ -36,10 +36,8 @@ for server in ${servers[@]}; do rsync -rptcv --fsync --chmod=D755,F644 --delete static-tmp/ $remote:$target ssh $remote "ln -snf $target /srv/grapheneos.org && sync /srv/grapheneos.org" - sed "s|/srv/grapheneos.org|$target|" nginx-tmp/nginx.conf > nginx-tmp/nginx.conf.root - rsync -rptcv --fsync --chmod=D755,F644 --delete nginx-tmp/nginx.conf.root $remote:/etc/nginx/nginx.conf - rsync -rptcv --fsync --chmod=D755,F644 --delete nginx-tmp/mime.types $remote:/etc/nginx/mime.types - rsync -rptcv --fsync --chmod=D755,F644 --delete nginx-tmp/snippets/ $remote:/etc/nginx/snippets + echo "root $target;" > nginx-tmp/root_grapheneos.org.conf + rsync -rptcv --fsync --chmod=D755,F644 --delete nginx-tmp/{nginx.conf,mime.types,root_grapheneos.org.conf,snippets} $remote:/etc/nginx/ ssh $remote nginx -s reload echo diff --git a/nginx/nginx.conf b/nginx/nginx.conf index b8785792..e24eb249 100644 --- a/nginx/nginx.conf +++ b/nginx/nginx.conf @@ -187,7 +187,7 @@ http { listen [::]:443 ssl http2; server_name grapheneos.org; - root /srv/grapheneos.org; + include root_grapheneos.org.conf; error_page 403 =404 /404; error_page 404 /404; diff --git a/nginx/root_grapheneos.org.conf b/nginx/root_grapheneos.org.conf new file mode 100644 index 00000000..5699478e --- /dev/null +++ b/nginx/root_grapheneos.org.conf @@ -0,0 +1,2 @@ +# placeholder for gixy +root /srv/grapheneos.org_a;