Simple Content Autonegotiation (F)CGI ===================================== This is a simple (Fast)CGI application that performs HTTP auto-negotiation and serves files staticly. It can be installed in the usual way with one of:: % pip install autoneg % easy_install autoneg It is intended to facilitate serving of different variants of an HTTP resource according to the requested content type. In this way one can pre-render RDF/XML, N3, HTML, plain text, etc variants of a document and save them to the filesystem to be served directly rather than relying on complicated databases or middleware. * Download: http://pypi.python.org/pypi/autoneg * Documentation: http://packages.python.org/autoneg * GIT Repository: http://github.com/wwaites/autoneg This work was sponsored by the `Open Knowledge Foundation`_ for use in * `Bibliographica`_ and `OpenBiblio`_ * `CKAN`_ * `LOD2`_ Scripts ------- .. automodule:: autoneg.app NGINX Configuration ------------------- Example configuration for a global installation:: location / { index index.html index.htm try_files $uri $uri/ /autoneg$uri; autoindex on; } location ~ ^/autoneg { fastcgi_pass unix:/var/run/autoneg.sock; include fastcgi_params; } And then the script could be launched with a command like:: % spawn-fcgi -P /var/run/autoneg.pid -s /var/run/autoneg.sock -M 0666 \ -- autoneg_fcgi -c conf.py -b /var/www the *try_files* means that if the file exists on disk it will be served correctly. Otherwise the request will be passed internally to the autonegotiation service. .. _Open Knowledge Foundation: http://okfn.org/ .. _Bibliographica: http://bibliographica.org/ .. _OpenBiblio: http://openbiblio.net/ .. _CKAN: http://ckan.net/ .. _LOD2: http://lod2.eu/