Got another nginx / mediawiki issue for you brilliant minds. All help appreciated!
I've got file uploads working, but after the upload is complete, the File:filename page shows as a 404.
For example:
http://www.mattselznick.com/thehumanitycontinuum/wiki/File:Shure_55s_1951.pn...
The section of my nginx conf file for the wiki looks like this:
# Location for the wiki's root location /thehumanitycontinuum/wiki/ { try_files $uri $uri/ @mediawiki; # Do this inside of a location so it can be negated location ~ .php$ { try_files $uri $uri/ =404; # Don't let php execute non-existent php files include /etc/nginx/fastcgi_params; fastcgi_pass unix:/var/run/php5-fpm.sock; } } location /thehumanitycontinuum/wiki/images { # Separate location for images/ so .php execution won't apply location ~ ^/thehumanitycontinuum/wiki/images/thumb/(archive/)?[0-9a-f]/[0-9a-f][0-9a-f]/([^/]+)/([0-9]+)px-.*$ { # Thumbnail handler for MediaWiki # This location only matches on a thumbnail's url # If the file does not exist we use @thumb to run the thumb.php script try_files $uri $uri/ @thumb; } } location /thehumanitycontinuum/wiki/images/deleted { # Deny access to deleted images folder deny all; } # Deny access to folders MediaWiki has a .htaccess deny in location /thehumanitycontinuum/wiki/cache { deny all; } location /thehumanitycontinuum/wiki/languages { deny all; } location /thehumanitycontinuum/wiki/maintenance { deny all; } location /thehumanitycontinuum/wiki/serialized { deny all; } # Just in case, hide .svn and .git too location ~ /.(svn|git)(/|$) { deny all; } # Hide any .htaccess files location ~ /.ht { deny all; } # Uncomment the following code if you wish to hide the installer/updater ## Deny access to the installer #location /thehumanitycontinuum/wiki/mw-config { deny all; } # Handling for the article path location @mediawiki { include /etc/nginx/fastcgi_params; # article path should always be passed to index.php fastcgi_param SCRIPT_FILENAME $document_root/thehumanitycontinuum/wiki/index.php; fastcgi_pass unix:/var/run/php5-fpm.sock; } # Thumbnail 404 handler, only called by try_files when a thumbnail does not exist location @thumb { # Do a rewrite here so that thumb.php gets the correct arguments rewrite ^/thehumanitycontinuum/wiki/images/thumb/[0-9a-f]/[0-9a-f][0-9a-f]/([^/]+)/([0-9]+)px-.*$ /thehumanitycontinuum/wiki/thumb.php?f=$1&width=$2; rewrite ^/thehumanitycontinuum/wiki/images/thumb/archive/[0-9a-f]/[0-9a-f][0-9a-f]/([^/]+)/([0-9]+)px-.*$ /thehumanitycontinuum/wiki/thumb.php?f=$1&width=$2&archived=1; # Run the thumb.php script include /etc/nginx/fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root/thehumanitycontinuum/wiki/thumb.php; fastcgi_pass unix:/var/run/php5-fpm.sock; }
I didn't read the other replies fully in time, but I would have recommended against the use of /thehumanitycontinuum/wiki/$1 + /thehumanitycontinuum/wiki/index.php if I did. Using any form of /wiki/index.php while using the same /wiki/$1 for the article path is never a good idea (it's typically a mistake). You get get most of the cons and bugs of using root article paths but none of the advantages.
For this bug it looks like it's dependent on the .png in the url, the nginx 404 disappears once the .png disappears. It happens when the url contains any well known file extension. Could you pastebin the whole config? It's probably either matching some non-wiki config or the result of an enabled nginx module.
~Daniel Friesen (Dantman, Nadir-Seen-Fire) [http://danielfriesen.name/]
On 2014-04-27, 11:15 AM, Matthew Wayne Selznick wrote:
Got another nginx / mediawiki issue for you brilliant minds. All help appreciated!
I've got file uploads working, but after the upload is complete, the File:filename page shows as a 404.
For example:
http://www.mattselznick.com/thehumanitycontinuum/wiki/File:Shure_55s_1951.pn...
Hi Daniel,
My responses inline...
On Sun, Apr 27, 2014 at 3:17 PM, Daniel Friesen daniel@nadir-seen-fire.com wrote:
I didn't read the other replies fully in time, but I would have recommended against the use of /thehumanitycontinuum/wiki/$1 + /thehumanitycontinuum/wiki/index.php if I did. Using any form of /wiki/index.php while using the same /wiki/$1 for the article path is never a good idea (it's typically a mistake). You get get most of the cons and bugs of using root article paths but none of the advantages.
I'm afraid much of that went over my head, but... what other replies? You were the first to reply to this thread.
Could you pastebin the whole config? It's probably either matching some non-wiki config or the result of an enabled nginx module.
You bet. Here's the mattselznick.com conf: http://pastebin.com/yUtrkkCz
And here's the W3TC conf included in the main conf: http://pastebin.com/66Y93Z3K
Thanks!
~Daniel Friesen (Dantman, Nadir-Seen-Fire) [http://danielfriesen.name/]
On 2014-04-27, 11:15 AM, Matthew Wayne Selznick wrote:
Got another nginx / mediawiki issue for you brilliant minds. All help appreciated!
I've got file uploads working, but after the upload is complete, the File:filename page shows as a 404.
For example:
http://www.mattselznick.com/thehumanitycontinuum/wiki/File:Shure_55s_1951.pn...
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
mediawiki-l@lists.wikimedia.org