Buggy example on wiki

There are two types of examples on wiki about how to catch/serve static
files.
The example A is not working correctly for names ending with the
extension.
I used the example A and added .tar files as static (location ~
^.+.(jpg|jpeg|gif|tar)$). I experienced troubles with
http://server.com/katar”. It was processed like static file

A)
location ~* ^.+.(jpg|jpeg|gif)$ {
is used in:
http://wiki.codemongers.com/NginxFullExample2
http://wiki.codemongers.com/NginxRuExample
http://wiki.codemongers.com/NginxDjangoFastCGI

B)
location ~* .(gif|jpg|jpeg)$ {
is used in core module documentation

do you agree to change examples A ?
is there a way to use mime type to catch static content ?

sincerely,
Martin

there is no bug in
location ~* ^.+.(jpg|jpeg|gif)$

but
location ~* .(gif|jpg|jpeg)$
is simpler and better

I agree.
It starts to be bug, if you copy it from the example as I did and use it
in case that you have link like http://www.server.com/katar served from
one location and also want catch “*.tar” from other location. Then it is
bug in the configuration. I spent some time to search for the reason why
it is not working.

So my suggestion is to correct the examples so no others will get into
the same trouble.

Martin

On Tue, Oct 23, 2007 at 02:05:27PM +0200, Martin Minka wrote:

There are two types of examples on wiki about how to catch/serve static
files.
The example A is not working correctly for names ending with the extension.
I used the example A and added .tar files as static (location ~
^.+.(jpg|jpeg|gif|tar)$). I experienced troubles with
http://server.com/katar”. It was processed like static file

The “.(jpg|jpeg|gif|tar)$” should not match “/katar”.

A)
location ~* ^.+.(jpg|jpeg|gif)$ {
is used in:
http://wiki.codemongers.com/NginxFullExample2
http://wiki.codemongers.com/NginxRuExample
http://wiki.codemongers.com/NginxDjangoFastCGI

As I understand the only NginxDjangoFastCGI is incorrect:

  • location ~* ^.+.(html|…
  • location ~* ^.+.(html|…

B)
location ~* .(gif|jpg|jpeg)$ {
is used in core module documentation

do you agree to change examples A ?

Where do you see “jpeg” ?

is there a way to use mime type to catch static content ?

No.

I am sorry that my mail was so confusing.
I did not checked the pages correctly. The problem is only on
http://wiki.codemongers.com/NginxDjangoFastCGI .
The jpeg is result of copping from Wiki in highlighting mode.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs