Created
July 3, 2014 09:36
-
-
Save shmaltorhbooks/1182ed08e3a51d3c2702 to your computer and use it in GitHub Desktop.
Nginx config for MediaWiki
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| server { | |
| listen 80; | |
| server_name mediawiki.com; | |
| root /var/www/mediawiki.com; | |
| client_max_body_size 5m; | |
| client_body_timeout 60; | |
| index index.php; | |
| 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 127.0.0.1:9013; | |
| } | |
| 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.com/local; | |
| autoindex on; | |
| } | |
| error_log /var/log/nginx/mediawiki.com.error.log; | |
| access_log /var/log/nginx/mediawiki.com.access.log; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment