Help for nginx proxy pass rule

Francis Daly francis at daoine.org
Wed Apr 6 21:47:01 UTC 2016


On Wed, Apr 06, 2016 at 06:58:07PM +0530, Roni Baby wrote:

Hi there,

> Yes the destination URl [https://www.xys.org/static/js/widget.js] is working
> perfectly alone
> Why it tried locally? I used proxypass rule for it. If I wanted to do
> anything to enable proxy capability in my Nginx?

Read http://nginx.org/r/location

Then do something like

  grep location your.conf

to see which location{} blocks you have defined.

Which one of those locations will nginx use to handle this request?

The error log suggests that this request is handled in a location that
is not the one that you showed -- perhaps one defined as something like

  location ~ js$ {

Possibly changing your

> location /static {

to

  location ^~ /static {

will make it work the way you want. That would tell nginx to choose it
instead of any regex one, for this request.


Separate from that: for the proxy_pass directive, you could probably drop
the "/static" part of the argument since it matches the request prefix.

But until the proxy_pass is actually used, changing it will make no
difference.

	f
-- 
Francis Daly        francis at daoine.org



More information about the nginx mailing list