Seeking for dynamic proxy_pass solution


I’d like to achieve something as follow using nginx -

When browsing to http://myserver/ for example,
I want proxy_pass to be set to;

Im getting somewhere but still need help,
Catching the argument this way -

In nginx config -
set $ip $arg_device;
proxy_pass http://$ip;

Which actually works but breaks when there’s an image/css/js, for
example -
[09/Mar/2014:23:05:44 +0200] “GET /?device= HTTP/1.1” 200
“-” "Mozilla/4.0 …
[09/Mar/2014:22:58:30 +0200] “GET /welcome.png HTTP/1.1” 500 594
http://server/?device=” "Mozilla/4.0 …

When I try to access http://server/?device= - It

What would be the easiest way to solve this so css,js,images will be
GET /?device=
and not just
GET /welcome.png

Thank you,

Posted at Nginx Forum:,248258,248258#msg-248258

Hi all,

I’ve managed to solve this, with nginx_substitutions_filter module

It’s very easily done.

Posted at Nginx Forum:,248258,248399#msg-248399

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