Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
server {
listen 80;
server_name rtfd.org *.rtfd.org;
if ($host ~* (.*)\.rtfd\.org) {
set $slug $1;
rewrite ^(.*)$ http://$slug.readthedocs.org;
}
rewrite ^/(\w+)$ http://$1.readthedocs.org/;
rewrite ^(.*)$ http://readthedocs.org/;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment