Welcome! Log In Create A New Profile


Re: Problem with MediaWiki File page

Francis Daly
September 22, 2011 07:32AM
On Thu, Sep 22, 2011 at 02:14:04AM +0530, BizHat.com Support wrote:

Hi there,

> location ~* \.(js|css|rdf|xml|ico|txt|gif|jpg|png|jpeg|html)$ {
> root /home/webhost/public_html/;
> access_log /var/log/nginx/webhostingneeds.com_static.log;
> }

> location / {
> proxy_pass;

(plus extra proxy settings)

> }

> The problem is when a file is uploaded to MediaWIki, i shows a page like
> http://webhostingneeds.com/File:FILENAME.exten
> For example
> http://webhostingneeds.com/File:Averttv_device_property.jpg
> Since the file extension is .jpg, nginx try to service this as static content.
> How i can set nginx to serve static files, pass anything starting with
> /File: to apache ?

nginx configuration is based on location blocks. One request is handled
by one location.

Details at http://wiki.nginx.org/HttpCoreModule#location

Your current config has one location for urls that match a regex, such
that they end in one of 11 specific strings; plus one location for
everything else.

You want a new location for urls that start with one specific string,
and you want regex locations not to be tested if this location matches.

So do exactly that:

location ^~ /File: {

and inside that location block, put your full proxy_pass and other
relevant configuration.

All the best,

Francis Daly francis@daoine.org

nginx mailing list
Subject Author Posted

Re: Problem with MediaWiki File page

Francis Daly September 22, 2011 07:32AM

Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 289
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready