From 3503a38f79aefdb79f2beadb28f2fca8ae123d21 Mon Sep 17 00:00:00 2001 From: Craig Oates Date: Sun, 14 Aug 2022 16:08:22 +0100 Subject: [PATCH] 2022.14.08.1 snapshot. commit 17d536ac7e9ad7a0a2ebb812151ac9a55fd87d78 Author: Craig Oates Date: Sun Aug 14 16:06:31 2022 +0100 create systemd and nginx config. files. These files are reference files to get hot-line set-up on the server. --- conf/hot-line-prod.conf | 30 ++++++++++++++++++++++++++++++ conf/hot-line-prod.service | 13 +++++++++++++ 2 files changed, 43 insertions(+) create mode 100644 conf/hot-line-prod.conf create mode 100644 conf/hot-line-prod.service diff --git a/conf/hot-line-prod.conf b/conf/hot-line-prod.conf new file mode 100644 index 0000000..46d791c --- /dev/null +++ b/conf/hot-line-prod.conf @@ -0,0 +1,30 @@ +upstream hunchentoot { + server 127.0.0.1:3002; +} + +server { + listen 80; + server_name charts.craigoates.net; + + root ~/quicklisp/local-projects/hot-line/templates/; + + # General request handling this will match all locations + location / { + + # check if with it's a directory and there'a an index.html + # if so, rewrite the url to include it and stop processing rules. + if (-f $request_filename/index.html) { + rewrite ^(.*) $1/index.html break; + } + + # Define custom HTTP Headers to be used when proxying + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header Host $host; + + # if the requested file does not exist then + # proxy to the hunchentoot server cluster + if (!-f $request_filename) { + proxy_pass http://hunchentoot; + } + } +} \ No newline at end of file diff --git a/conf/hot-line-prod.service b/conf/hot-line-prod.service new file mode 100644 index 0000000..d610641 --- /dev/null +++ b/conf/hot-line-prod.service @@ -0,0 +1,13 @@ +[Unit] +Description=Production version of charts.craigoates.net. +After = syslog.target network.target + +[Service] +ExecStart=/usr/bin/sbcl --eval '(ql:quickload :hot-line)' --eval '(setf (osicat:environment-variable "APP_ENV") "production")' --eval '(hot-line:main)' +Restart=always +RestartSec=10 +KillSignal=SIGINT +User=craig + +[Install] +WantedBy=multi-user.target \ No newline at end of file