Countly/countly-server — pull request #40 by ubershmekel (2012-12-17 20:28:30+00:00)
Title: Subsite countly

This is related to Issue #19 as I wanted to try out countly on my VPS without getting another domain name.

Here's the nginx config I used:

```server {
listen 80;
server_name 127.0.0.1;

access_log off;

location = /ct/i {
rewrite /ct/(.*) /$1 break;
proxy_pass http://127.0.0.1:3001;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP $remote_addr;
}

location = /ct/o {
rewrite /ct/(.*) /$1 break;
proxy_pass http://127.0.0.1:3001;
}

location /ct/ {
rewrite /ct/(.*) /$1 break;
proxy_pass http://127.0.0.1:6001;
proxy_set_header Host $http_host;
}
}```

Notice the rewrites make countly believe it's a root app. Most of the works was rewiring the html, css js and images to work with . I didn't thoroughly test this patch, but I did find that prefixfree has a bug which breaks some CSS https://github.com/LeaVerou/prefixfree/issues/134 but other than that it seems to work.