Skip to content

Instantly share code, notes, and snippets.

@christianparpart
Created April 3, 2014 09:54
Show Gist options
  • Save christianparpart/9951735 to your computer and use it in GitHub Desktop.
Save christianparpart/9951735 to your computer and use it in GitHub Desktop.
sample x0d.conf
# vim:syntax=flow
import accesslog from 'x0d/plugins';
import director from 'x0d/plugins/director';
import access from 'x0d/plugins';
import status from 'x0d/plugins';
import auth from 'x0d/plugins';
handler setup {
# workers 4;
# workers [0, 1, 2, 3];
listen address: 0.0.0.0, port: 8080;
# mimetypes
mimetypes '/etc/mime.types';
mimetypes.default 'text/plain';
director.load 'ialu-app', './ialu-app.db';
}
handler main {
# we currently have HAproxy infront, with health checks enabled, so make it happy w/o bloating local logs
if req.path == '/health' { respond 200; }
if req.path == '/server-status' { status; }
if req.path == '/nginx_status' { status.nginx_compat; }
director.api '/x0/director';
if req.host == 'ialu.de' {
docroot '/srv/ialu.de/current/public/';
match req.path {
on '/chat/listen',
on '/chat/activity',
on '/chat/send' {
director.fcgi address: 127.0.0.1, port: 3100;
}
else {
#precompressed;
staticfile;
director.balance 'ialu-app';
}
}
} else {
redirect "https://ialu.de";
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment