Welcome! Log In Create A New Profile

Advanced

Re: Problem with MediaWiki File page

António P. P. Almeida
September 22, 2011 09:46AM
On 21 Set 2011 21h44 WEST, info@bizhat.com wrote:

> HI,
>
> I have following nginx configuration for a MediaWiki based site
>
>
> server {
> listen 174.36.130.243:80;
> server_name webhostingneeds.com www.webhostingneeds.com;
>
> 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 http://174.36.130.243:81/;
> proxy_redirect off;
> proxy_set_header Host $host;
> proxy_set_header X-Real-IP $remote_addr;
> proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
> client_max_body_size 1m;
> client_body_buffer_size 128k;
> proxy_connect_timeout 90;
> proxy_send_timeout 90;
> proxy_read_timeout 90;
> proxy_buffer_size 4k;
> proxy_buffers 4 32k;
> proxy_busy_buffers_size 64k;
> proxy_temp_file_write_size 64k;
> }
> }
>
> The problem is when a file is uploaded to MediaWIki, i shows a page
> like
>
> http://webhostingneeds.com/File:FILENAME.exten

This should work:

location / {

proxy_pass http://174.36.130.243:81/;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
client_max_body_size 1m;
client_body_buffer_size 128k;
proxy_connect_timeout 90;
proxy_send_timeout 90;
proxy_read_timeout 90;
proxy_buffer_size 4k;
proxy_buffers 4 32k;
proxy_busy_buffers_size 64k;
proxy_temp_file_write_size 64k;

location ^~ /File: {

location ~* /File:[^/]*\.(?:jpe?g|png|gif|html)$ {
proxy_pass http://174.36.130.243:81/;
}
}
}

> 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 ?

--- appa

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Re: Problem with MediaWiki File page

António P. P. Almeida September 22, 2011 09:46AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 216
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