# A dynamic web-site written wholly in nginx.conf? Introducing mdoc.su!

**URL:** <https://www.ruby-forum.com/t/a-dynamic-web-site-written-wholly-in-nginx-conf-introducing-mdoc-su/226684>\
**Category:** NGINX\
**Created:** [February 18, 2013, 10:47am UTC](https://www.ruby-forum.com/t/a-dynamic-web-site-written-wholly-in-nginx-conf-introducing-mdoc-su/226684 "2013-02-18T10:47:22Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Constantine\_ASMure](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/3ec8ea/32.png) [@Constantine\_ASMure](https://www.ruby-forum.com/u/Constantine_ASMure)\
**Post date:** [February 18, 2013, 10:47am UTC](https://www.ruby-forum.com/t/a-dynamic-web-site-written-wholly-in-nginx-conf-introducing-mdoc-su/226684/1 "2013-02-18T10:47:22Z")

</div>

Dear nginx@,

I’m not sure if this has already been done before and to what extent,  
but I’d like to demonstrate that a whole web-service “portal” can be  
written exclusively in nginx.conf, without any php, perl, python, java  
or cgi, or even any files external to nginx.conf.

Introducing [http://mdoc.su/](http://mdoc.su/) .

The service provides deterministic URL tinyfication / URI shortening for  
BSD manual pages.

How does it work?

It operates on 3 inputs: the operating system, the section and the  
manual page.

For example, to see the kqueue(2) manual page from FreeBSD, you can  
point your browser to [kqueue](http://mdoc.su/f/kqueue) , or mdoc.su/f/kqueue.2,  
or mdoc.su/f/2/kqueue, or you can even use “FreeBSD” or “freebsd” in  
place of “f”, as in, [http://mdoc.su/freebsd/kqueue](http://mdoc.su/freebsd/kqueue) etc.

When nginx receives the request, it quickly gets re-written, and a  
redirect to [FreeBSD Manual Pages](http://FreeBSD.org/cgi/man.cgi) is produced.

Same for OpenBSD, NetBSD and DragonFly BSD, of course.

Forgot how to specify timeouts for ssh(1)? [ssh(1) - OpenBSD manual pages](http://mdoc.su/o/ssh)

The site even has a start page, also exclusively through nginx.conf, and  
supports Google Webmaster Tools site verification, through the “HTML  
file upload” option, through nginx.conf (of course!). (BTW, the format  
of those verification files has changed a couple of years back, where  
special and unique file content is now required, and the new file format  
itself is a very-very big secret, that Google will not share with anyone  
without a file-save-capable browser or an NDA! Reverse-engineered with  
nginx.conf, too!)

Notice that the whole ordeal runs entirely out of nginx and is  
controlled by an nginx.conf file, which I think is pretty nifty. 🙂

The source code is available at [GitHub - cnst/mdoc.su: Deterministic URL shortener for BSD manual pages, written in nginx.conf](https://github.com/cnst/mdoc.su) , and  
might also be attached to this message.

Comments, questions and suggestions are very welcome.

P.S. Prior multi-part message was a result of trying to hand-edit  
“Content-Disposition: attachment;” to “inline” through E /  
“edit-headers” in mutt, after pasting the message from SeaMonkey. 🙂  
But mail.content\_disposition\_type set to 0 should now work much better.

Best regards,  
Constantine.

---

<div class="post-metadata">

**Author:** ![Constantine\_ASMure](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/3ec8ea/32.png) [@Constantine\_ASMure](https://www.ruby-forum.com/u/Constantine_ASMure)\
**Post date:** [February 18, 2013, 2:58pm UTC](https://www.ruby-forum.com/t/a-dynamic-web-site-written-wholly-in-nginx-conf-introducing-mdoc-su/226684/2 "2013-02-18T14:58:10Z")

</div>

nice catch! i’d suggest you create the same stuff for ReactOS too (or  
maybe  
linux?)  
so you could have

> f | n | o | r | d or  
> f | n | o | l | d

regards,

mex

… please forgive me that blasphemous references 🙂

Posted at Nginx Forum:  
[http://forum.nginx.org/read.php?2,236283,236298#msg-236298](http://forum.nginx.org/read.php?2,236283,236298#msg-236298)
