Here is a simple NGINX configuration that will handle static files and serve werc from an fcgi proxy like cgd running on port 3333:
server {
listen 80;
server_name *.cat-v.org;
set $werchome /home/uriel/dvl/werc/; # Location of your werc installation
root $werchome/sites/$host/;
index index.html;
location / {
try_files $uri @werc;
}
location /pub/ {
root $werchome;
try_files $uri =404;
}
location = /favicon.ico {
root $werchome;
try_files $werchome/$host/$uri /pub/default_favicon.ico =404;
}
error_page 404 = @werc;
location @werc {
include fastcgi_params;
fastcgi_pass localhost:3333;
}
}
Then run cgd like this: cgd -f -c /home/uriel/dvl/werc/bin/werc.rc
Once you have it working you can create a systemd unit to run cgd as a daemon.
e.g. /lib/systemd/system/cgd-werc.service
[Unit]
Description=Job that runs cgd for my cool swerc site.
[Service]
Type=simple
ExecStart=/home/cbrooks/develop/bin/cgd -f -c /home/cbrooks/swerc/bin/werc.rc
Maybe I'm not the best with systemd stuff, but I haven't been able to enable and start the newly created service without it having an
[Install]
section in it. Without that, when attempting to start the service I get the following message:I added the following to the service file to get it to work properly: