FAQ

Page Discussion History

MediaWiki

Revision as of 02:42, 29 September 2011 by MichaelLustfield (Talk)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Here's the basic configuration used for the Nginx wiki.

server {
        server_name wiki.nginx.org;
        root /var/www/mediawiki;
 
        client_max_body_size 5m;
        client_body_timeout 60;
 
        location / {
                try_files $uri $uri/ @rewrite;
        }
 
        location @rewrite {
                rewrite ^/(.*)$ /index.php?title=$1&$args;
        }
 
        location ^~ /maintenance/ {
                return 403;
        }
 
        location ~ \.php$ {
                include fastcgi_params;
                fastcgi_pass unix:/tmp/phpfpm.sock;
        }
 
        location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
                try_files $uri /index.php;
                expires max;
                log_not_found off;
        }
 
        location = /_.gif {
                expires max;
                empty_gif;
        }
 
        location ^~ /cache/ {
                deny all;
        }
 
        location /dumps {
                root /var/www/mediawiki/local;
                autoindex on;
        }
}

NOTE! In order for this configuration to work, you will need to set "$wgUsePathInfo = TRUE;" in your LocalSettings.php file.