NGINX: reverse proxy

Let's say you want to access a transmission instance via, you need this configuration inside the server block:

location / {
   proxy_pass http://localhost:9091;

NGINX: IP address filtering

IP filtering is written inside the server block.

If for example you want to protect, you need to write this:

location /files {
   deny all;

With this, only the network will be able to access

FIREFOX: updating/removing 301's cache

If you already had the issue, you know it's a pain in the ass.

Testing some http/https redirections, and Firefox cached the 301, and keeps using them.

To stop it from doing that, you need to go to about:config, and search for browser.cache.check_doc_frequency.

Once you found it, change its value to "1", refresh the page w/ which you had the problem, check it doesn't happen anymore, and changed the value back to 3 (its default value).

LIGHTTPD: restricting access

$HTTP["remoteip"] !~ "|" {
        $HTTP["url"] =~ "" {
        url.access-deny = ( "" )

You need to put it in the lighttpd's host block, so that only and can access it.

LIGHTTPD: reverse proxy

$HTTP["host"] == "" {
     proxy.server = ( "" => (("host" => "yourip", "port" => 8080 )))

So when you visit, you'll be redirected on whatever is on the port 8080 of yourip.

FIREFOX: removing tooltips

To remove tooltips ("mouseover popups) in firerox, you just need to switch from true to false.

GIT: cgit automatic repo creation

Here's the function (use it as it is or as a script, doesn't matter):

function create_git_repo() {
if [ -z "$1" ]
    echo "'/!\' You need a repo name '/!\'"
mkdir ~/$1.git
cd ~/$1.git && git init --bare
echo -e "\nrepo.url=$1
repo.desc=$1 stuff
repo.owner=youruser" >> /etc/cgitrc
echo 'repo.clone-url=git@yoururl:~/$CGIT_REPO_URL.git' >> /etc/cgitrc
cd $wd

You'll need to do the first push with git push -u origin master.

It's needed to check if an argument is given, because if a repo with no name is created, cgit will segfault when we want to check any repo.