From 263610807bef4df0e406f467c18fdd62c224fa76 Mon Sep 17 00:00:00 2001 From: facundoolano Date: Wed, 21 Feb 2024 19:19:16 -0300 Subject: [PATCH] add deploy files --- docs/Makefile | 3 +++ docs/nginx-sites-available | 22 ++++++++++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 docs/Makefile create mode 100644 docs/nginx-sites-available diff --git a/docs/Makefile b/docs/Makefile new file mode 100644 index 0000000..4c9bfd1 --- /dev/null +++ b/docs/Makefile @@ -0,0 +1,3 @@ +deploy: + jorge build + rsync -vPrz --delete target/ root@olano.dev:/var/www/jorge diff --git a/docs/nginx-sites-available b/docs/nginx-sites-available new file mode 100644 index 0000000..a088bf0 --- /dev/null +++ b/docs/nginx-sites-available @@ -0,0 +1,22 @@ +# helper to get a var with the uri with stripped trailing slash +map $uri $uri_no_trailing_slash { + "~^(?P.+?)/$" $path; + default $uri; +} + +server { + + charset utf-8; + + root /var/www/jorge; + + server_name jorge.olano.dev; + + location / { + # First attempt to serve request as file, then as directory. + # also handle the case where there's a file instead of a dir, but + # the request comes with trailing slash --we still want to serve the file in that case. + # otherwise respond 404. + try_files $uri $uri.html $uri/ $uri_no_trailing_slash $uri_no_trailing_slash.html =404; + } +}