Discussion:
nginx config problems...
Steve Holdoway
2011-08-20 03:21:41 UTC
Permalink
I've got an install that I'm looking to migrate to nginx from apache for
performance reasons. I've stumbled into this problem, and google is
failing me...

In the header is...

<script type="text/javascript"
src="/js/prototype/prototype.js,/js/lib/ccard.js,/js/prototype/validation.js></script>


and in the error log is...

2011/08/19 20:02:25 [error] 24124#0: *6 access forbidden by rule,
client: x.x.x.x, server: www.example.com, request:
"GET /js/prototype/prototype.js,/js/lib/ccard.js,/js/prototype/validation.js. HTTP/1.1", host: "www.example.com", referrer: "http://www.example.com.com/"

Can anyone suggest a rule that would allow it???

( CentOS 5, nginx 1.0.5, php-fpm 5.3.7 ).

Cheers,

Steve
--
Steve Holdoway BSc(Hons) MNZCS <***@greengecko.co.nz>
http://www.greengecko.co.nz
MSN: ***@greengecko.co.nz
Skype: sholdowa
Robin Sheat
2011-08-20 04:44:38 UTC
Permalink
Post by Steve Holdoway
<script type="text/javascript"
src="/js/prototype/prototype.js,/js/lib/ccard.js,/js/prototype/validation.j
s></script>
I don't think you can join with commas like that (I may be wrong, I'm not
really a big HTML person.) Also, you're missing a trailing quote. That
probably won't make a difference though.
Post by Steve Holdoway
and in the error log is...
2011/08/19 20:02:25 [error] 24124#0: *6 access forbidden by rule,
"GET
/js/prototype/prototype.js,/js/lib/ccard.js,/js/prototype/validation.js.
"http://www.example.com.com/"
This error would imply the browser agrees with me, it's asking in one big
request.

Robin.
Steve Holdoway
2011-08-20 04:56:16 UTC
Permalink
Post by Robin Sheat
Post by Steve Holdoway
<script type="text/javascript"
src="/js/prototype/prototype.js,/js/lib/ccard.js,/js/prototype/validation.j
s></script>
I don't think you can join with commas like that (I may be wrong, I'm not
really a big HTML person.) Also, you're missing a trailing quote. That
probably won't make a difference though.
Post by Steve Holdoway
and in the error log is...
2011/08/19 20:02:25 [error] 24124#0: *6 access forbidden by rule,
"GET
/js/prototype/prototype.js,/js/lib/ccard.js,/js/prototype/validation.js.
"http://www.example.com.com/"
This error would imply the browser agrees with me, it's asking in one big
request.
Robin.
Syntax seems to be acceptable to apache, and I have seen it used as
shorthand elsewhere - which is why I'm fighting to get it working.

Cheers,

Steve
--
Steve Holdoway BSc(Hons) MNZCS <***@greengecko.co.nz>
http://www.greengecko.co.nz
MSN: ***@greengecko.co.nz
Skype: sholdowa
Hadley Rich
2011-08-20 05:08:43 UTC
Permalink
Post by Steve Holdoway
Syntax seems to be acceptable to apache, and I have seen it used as
shorthand elsewhere - which is why I'm fighting to get it working.
I've not come across a comma separated list in a src attribute before
and I can't find reference to it in the specification (though it's
certainly possible that I missed it).

hads
--
http://nicegear.co.nz
New Zealand supplier of VoIP & Hobby Electronics


_______________________________________________
NZLUG mailing list ***@linux.net.nz
http://www.linux.net.nz/cgi-bin/mailman/listinfo/nzlug
Robin Sheat
2011-08-20 05:27:44 UTC
Permalink
Post by Steve Holdoway
Syntax seems to be acceptable to apache, and I have seen it used as
shorthand elsewhere - which is why I'm fighting to get it working.
It might be that it's an apache extension. Does it work if you split them up?
Given the log, it not understood by the browser, so the only other answer I
see is that Apache understands this where nginix doesn't.

Of course, part of nginix's speedy lightness is that it doesn't do nearly as
much as apache, so you may just be out of luck. On the other hand, perhaps
there's an addon or something for it.

Robin.
Reed Wade
2011-08-20 06:44:04 UTC
Permalink
Post by Steve Holdoway
Syntax seems to be acceptable to apache, and I have seen it used as
shorthand elsewhere - which is why I'm fighting to get it working.
If so that's kind of bizarre and likely to cause problems elsewhere.
It's not very unusual to find commas in urls.

Nginx has some pretty wild url rewriting features which might be
coerced into giving this behaviour but -- really, I'd save that for
something positive and clever and that doesn't fight existing
practise.

-reed

_______________________________________________
NZLUG mailing list ***@linux.net.nz
http://www.linux.net.nz/cgi-bin/mailman/listinfo/nzlug
Reed Wade
2011-08-20 06:55:13 UTC
Permalink
Also, and this is, once again, not answering your actual question--

But, if you're just looking to offload static file handling from
Apache to improve performance you can put nginx in front of apache and
have it handle static requests and proxy others through to apache.
Sounds ugly or slow but works very nicely.

Or, even simpler, completely separate: static.example.com serviced
using nginx, www.example.com by apache.

-reed

_______________________________________________
NZLUG mailing list ***@linux.net.nz
http://www.linux.net.nz/cgi-bin/mailman/listinfo/nzlug
Jordan Thoms
2011-08-21 00:57:40 UTC
Permalink
Agreed, I have used this for a long time and it works very well. Most of the
advantages of php-fpm etc but with the features of apache/ wide support.

Cheers,
Jordan
Mobile: +64 21 144 8935
Post by Reed Wade
Also, and this is, once again, not answering your actual question--
But, if you're just looking to offload static file handling from
Apache to improve performance you can put nginx in front of apache and
have it handle static requests and proxy others through to apache.
Sounds ugly or slow but works very nicely.
Or, even simpler, completely separate: static.example.com serviced
using nginx, www.example.com by apache.
-reed
_______________________________________________
http://www.linux.net.nz/cgi-bin/mailman/listinfo/nzlug
_______________________________________________
NZLUG mailing list ***@linux.net.nz
http://www.linux.net.nz/cgi-bin/mailman/listinfo/nzlug
Steve Holdoway
2011-08-21 01:14:50 UTC
Permalink
TBH I can't see the point of using Apache *at all* in this environment.
Apart from the performance improvements of nginx+php-fpm instead of the
usual apache+mod_php, the memory footprint is also decimated.

All that *most* LAMP sites require from apache is mod_expires, compress
and a bit of rewrite. If you can convert the rewrites, then you're
sorted. This is the first site where I've not been able to get it
running properly... eventually.

Admittedly having to work with 3 sets of timeouts ( php, nginx, and
between the two ) is a bit of a pain...

Cheers,


Steve
Post by Jordan Thoms
Agreed, I have used this for a long time and it works very well. Most of the
advantages of php-fpm etc but with the features of apache/ wide support.
Cheers,
Jordan
Mobile: +64 21 144 8935
Post by Reed Wade
Also, and this is, once again, not answering your actual question--
But, if you're just looking to offload static file handling from
Apache to improve performance you can put nginx in front of apache and
have it handle static requests and proxy others through to apache.
Sounds ugly or slow but works very nicely.
Or, even simpler, completely separate: static.example.com serviced
using nginx, www.example.com by apache.
-reed
_______________________________________________
http://www.linux.net.nz/cgi-bin/mailman/listinfo/nzlug
_______________________________________________
http://www.linux.net.nz/cgi-bin/mailman/listinfo/nzlug
--
Steve Holdoway BSc(Hons) MNZCS <***@greengecko.co.nz>
http://www.greengecko.co.nz
MSN: ***@greengecko.co.nz
Skype: sholdowa
Volker Kuhlmann
2011-08-20 09:01:27 UTC
Permalink
Post by Steve Holdoway
src="/js/prototype/prototype.js,/js/lib/ccard.js,/js/prototype/validation.j
Well the way I read that it's just accessing a path that happens to
contain two commas. Dunno whether commas are legal in URLs (spaces are
not) but I don't see why not. You'll just have to read the ginks docs to
see why it's barfing at the URL. At a guess, one of the processing
stages has a filter that doesn't like that URL.

Volker
--
Volker Kuhlmann is list0570 with the domain in header.
http://volker.dnsalias.net/ Please do not CC list postings to me.

_______________________________________________
NZLUG mailing list ***@linux.net.nz
http://www.linux.net.nz/cgi-bin/mailman/listinfo/nzlug
Phillip Hutchings
2011-08-20 06:33:16 UTC
Permalink
It looks like you have mod_concat or similar installed in Apache, which would take a list like that and return a single file.

You'll either have to concatenate using a third party tool outside the webserver or break it in to separate script tags.

I did find this post about making the server do it automatically: http://www.gethifi.com/blog/Automatic-file-minification-on-nginx
Post by Steve Holdoway
I've got an install that I'm looking to migrate to nginx from apache for
performance reasons. I've stumbled into this problem, and google is
failing me...
In the header is...
<script type="text/javascript"
src="/js/prototype/prototype.js,/js/lib/ccard.js,/js/prototype/validation.js></script>
and in the error log is...
2011/08/19 20:02:25 [error] 24124#0: *6 access forbidden by rule,
"GET /js/prototype/prototype.js,/js/lib/ccard.js,/js/prototype/validation.js. HTTP/1.1", host: "www.example.com", referrer: "http://www.example.com.com/"
Can anyone suggest a rule that would allow it???
( CentOS 5, nginx 1.0.5, php-fpm 5.3.7 ).
Cheers,
Steve
--
http://www.greengecko.co.nz
Skype: sholdowa
_______________________________________________
http://www.linux.net.nz/cgi-bin/mailman/listinfo/nzlug
--
Phillip Hutchings
***@sitharus.com




_______________________________________________
NZLUG mailing list ***@linux.net.nz
http://www.linux.net.nz/cgi-bin/mailman/listinfo/nzlug
Cliff Pratt
2011-08-20 23:49:30 UTC
Permalink
Post by Steve Holdoway
I've got an install that I'm looking to migrate to nginx from apache for
performance reasons. I've stumbled into this problem, and google is
failing me...
In the header is...
<script type="text/javascript"
src="/js/prototype/prototype.js,/js/lib/ccard.js,/js/prototype/validation.js></script>
and in the error log is...
2011/08/19 20:02:25 [error] 24124#0: *6 access forbidden by rule,
"GET /js/prototype/prototype.js,/js/lib/ccard.js,/js/prototype/validation.js. HTTP/1.1", host: "www.example.com", referrer: "http://www.example.com.com/"
Can anyone suggest a rule that would allow it???
( CentOS 5, nginx 1.0.5, php-fpm 5.3.7 ).
Steve, is that valid html with the commas in the 'src'?

Cheers,

Cliff

_______________________________________________
NZLUG mailing list ***@linux.net.nz
http://www.linux.net.nz/cgi-bin/mailman/listinfo/nzlug
Loading...