diff --git a/conf/ritherdon-archive.conf b/conf/ritherdon-archive.conf new file mode 100644 index 0000000..0fb4086 --- /dev/null +++ b/conf/ritherdon-archive.conf @@ -0,0 +1,30 @@ +upstream woo { + server 127.0.0.1:3001; +} + +server { + listen 80; + server_name www.nicolaellisandritherdonarchive.com nicolaellisandritherdonarchive.com; + + root ~/quicklisp/local-projects/ritherdon-archive/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 woo server cluster + if (!-f $request_filename) { + proxy_pass http://woo; + } + } +} \ No newline at end of file diff --git a/conf/ritherdon-archive.service b/conf/ritherdon-archive.service new file mode 100644 index 0000000..a074a30 --- /dev/null +++ b/conf/ritherdon-archive.service @@ -0,0 +1,13 @@ +[Unit] +Description=Nicola Ellis and Ritherdon Archive website. +After = syslog.target network.target + +[Service] +ExecStart=/usr/bin/sbcl --eval '(ql:quickload :co-web)' --eval '(setf (osicat:environment-variable "APP_ENV") "production")' --eval '(ritherdon-archive:main)' +Restart=always +RestartSec=10 +KillSignal=SIGINT +User=nic + +[Install] +WantedBy=multi-user.target