Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am having a bit of problem of configuring Nginx in place of Apache, so that it served Mumble Django to clients. I have vhosts configs for both Apache and Lighttpd - let me put them here side by side, to save you a click :) . Apache2 utilized WSGI to run Django Python as CGI. Lighttpd, as far as I can see, works like Nginx/PHP-FPM.

Dedicated Apache2 vhosts - config:

<VirtualHost *:80>

        Alias                   /static/admin/  /usr/share/pyshared/django/contrib/admin/static/admin/
        Alias                   /static/        /srv/mumble-django/htdocs/
        Alias                   /mumble/media/  /srv/mumble-django/pyweb/mumble/media/

        WSGIScriptAlias         /               /srv/mumble-django/mumble-django.wsgi
        WSGIDaemonProcess       mumble-django threads=25
        WSGIProcessGroup        mumble-django
        WSGIScriptReloading     Off

        # Cache optimization - not necessarily needed for MD, but nice to have :)
        FileETag None
        <IfModule mod_headers.c>
                Header unset ETag

                <FilesMatch "\.(ico|pdf|flv|jpg|jpeg|png|gif|js|css|swf)$">
                        Header set Cache-Control "max-age=86400, must-revalidate"

                <IfModule mod_deflate.c>
                        # compress content
                        AddOutputFilterByType DEFLATE text/html text/plain text/css text/javascript image/png image/jpeg image/gif
                        # properly handle requests coming from behind proxies
                        Header append Vary User-Agent

Lighttpd config:

server.document-root = "/usr/local/www/mumble-django"
  alias.url = (
    "/static" => "/usr/local/www/mumble-django/htdocs/",
    "/media"  => "/usr/local/lib/python2.6/site-packages/django/contrib/admin/media/"
  url.rewrite-once = (
    "^(/media.*)$" => "$1",
    "^(/static.*)$" => "$1",
    "^(/.*)$" => "/mumble-django.fcgi$1",
  fastcgi.server = (
    "/mumble-django.fcgi" => (
      "" => (
        "socket" => "/tmp/mumble-django.sock",
        "check-local" => "disable"

And my shameful Nginx config file, which I converted, is this:

server {
    listen 80;
    server_name_in_redirect on; # SEO: Avoid different host-names!
    server_tokens off;
    root /home/shehi/www-data/subdomains/mumble_web_ui;
    merge_slashes on;
    msie_padding on;
    client_max_body_size 64M;
    index index.php;
    error_log /home/shehi/logs/error_log debug;

    location /static
        alias /home/shehi/www-data/subdomains/mumble_web_ui/htdocs/;

    location /media
        alias /home/shehi/www-data/subdomains/mumble_web_ui/pyweb/mumble/media/;

    location /
#       rewrite ^(/.*)$ /mumble-django.fcgi$1 last;
#       try_files $uri $uri/ /mumble-django.fcgi$uri;
        gzip on;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_param PATH_INFO $fastcgi_script_name;
        include fastcgi_params;

Apparently, my configuration ends up in infinite loops: .../mumble/mumble/ 

So, in short, what is it that I am doing wrong here? Thank you all for all help in advance!

share|improve this question

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.