Help with nginx.conf file for proxying
T Gillett
tgillett1 at powerup.com.au
Fri Nov 3 10:13:03 MSK 2006
Igor Sysoev <is at ...> writes:
> >
> > #proxy NSLU2 web admin, located on 192.168.1.77:80
> > location /nslu2/ {
> > proxy_pass http://192.168.1.77:80/;
>
> You should change the line above to
>
> proxy_pass http://192.168.1.77:80/nslu2/;
> or to
> proxy_pass http://192.168.1.77:80;
>
> > proxy_redirect default;
> > }
> > }
> >
> > server {
> > listen 7008;
> > server_name nslu2;
> >
> > #proxy NSLU2 web admin
> > location / {
> > proxy_pass http://192.168.1.77:80/;
> > proxy_redirect default;
> > }
> > }
>
> Igor Sysoev
> http://sysoev.ru/en/
>
>
Igor
Thanks for the response. A couple of points:
- The address in the proxy_ pass line has to have the trailing / or it doesn’t
bring up the page at all.
- The home page of the NSLU2 device is at http://192.168.1.77:80. If I add the
/nslu2/ as you suggest I get a “Page not found” screen back from the NSLU2
To illustrate the problem, the two sequences below show the series of URLs that
are used when accessing the NSLU2 device directly, and then through the proxy
server. Both work the same until I get to the third step when it fails through
the proxy server. This is obviously because there is no valid page at
http://192.168.1.77:7007/mydir.
The required page is at http://192.168.1.77:7007/nslu2/mydir
If I manually edit the URL in the browser to include /nslu2 in front of the
/mydir in the URL it goes to the right page. The same will happen for all
further links.
Accessing the NSLU2 directly:
Start at Home page: http://192.168.1.77/
Login link on Home page: http://192.168.1.77/login.cgi
Browse Files page, select mydir: http://192.168.1.77/mydir/
Accessing the NSLU2 through nginx with my conf file:
Start at Home page: http://192.168.1.77:7007/nslu2/
Login link on Home page: http://192.168.1.77:7007/nslu2/login.cgi
Browse Files page, select mydir: http://192.168.1.77:7007/mydir
It seems to me that I am missing something in the conf file to make the proxy
server include 7007:/nslu2 in the URL instead of just :7007
Thanks for any suggestions.
Regards
Terry
More information about the nginx
mailing list