Skip to content

Instantly share code, notes, and snippets.

View ricsiga's full-sized avatar

Richárd Tóth ricsiga

View GitHub Profile
@ricsiga
ricsiga / nginx_virtual_document_root.conf
Last active November 23, 2022 14:19
virtual document root for Nginx
# [0-9].example.com -> /srv/tickets.example.com/[0-9]/app/build
# http://nginx.org/en/docs/http/server_names.html
server {
listen 80;
server_name "~^(?<subdomain>^\d).example.com$";
root /srv/tickets.example.com/$subdomain/app/build;
}
@ricsiga
ricsiga / lxc-debian.sh
Last active May 26, 2016 13:08
create debian lxc container without systemd
#!/bin/bash
#
# lxc: linux Container library
# Authors:
# Daniel Lezcano <daniel.lezcano@free.fr>
# Modified:
# Claudio Kuenzler
@ricsiga
ricsiga / varnish_redirect_example.vcl
Last active November 30, 2019 17:46
redirect in Varnish 4
sub vcl_recv {
if (req.http.host == "www.example.com") {
set req.http.location = "http://example.com" + req.url;
return (synth(750, "Permanently moved"));
}
}
sub vcl_synth {
if (resp.status == 750) {
set resp.http.location = req.http.location;
@ricsiga
ricsiga / repcached.service
Created May 4, 2016 11:57
repcached systemd unit file example
[Unit]
Description=repcached - add data replication feature to memcached 1.2.x
After=network.target
[Service]
ExecStart=/opt/repcached/bin/memcached -m 256 -p 11211 -u root -P /var/run/memcachedrep.pid -x 1.2.3.4 -d
Type=forking
PIDFile=/var/run/memcachedrep.pid
Restart=always