Open main menu

Changes

1,166 bytes added ,  15:18, 14 November 2019
no edit summary
The purpose of this page is to merge two different configurations for Pretty URLs for MediaWiki on Nginx into the ultimate configuration. The first is my current configuration which is a combination of what comes from DebOps, and the code found on MediaWiki.org. The second is the suggested configuration from shorturls.redwerks.com
 
 
== My Nginx Conf ==
<syntaxhighlight lang="php" line>
== The Ultimate Pretty URL configuration for MediaWiki on Nginx ==
<syntaxhighlight lang="php" line>
 
server {
 
# [...]
 
if (-f $document_root/maintenance.html) {
return 503;
}
error_page 503 @maintenance;
location @maintenance {
rewrite ^(.*)$ /maintenance.html break;
}
 
# Disallow access to hidden files and directories, except `/.well-known/`
# https://www.mnot.net/blog/2010/04/07/well-known
# https://tools.ietf.org/html/rfc5785
location ~ /\.(?!well-known/) {
return 404;
}
 
location = /nginx_status {
stub_status on;
access_log off;
allow 127.0.0.1/32;
allow ::1/128;
allow 67.205.190.17;
allow 10.10.0.11;
allow 10.136.225.163;
deny all;
}
 
</syntaxhighlight>