Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm trying to come up with a configuration for utorrent server using nginx. Here is what I have so far:

server {
  # etc...

  location /utorrent {
    proxy_pass http://127.0.0.1:8080/gui/;
    proxy_redirect    off;
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  }
}

I have other locations defined as well. The problem is that the static assets on the root path such as /whatever.js are hitting my true root path and not the reverse proxy. Do I need a rewrite rule to handle this? If so, what should it be. I've tried a ton of different combinations. One of those was to have a regular expression in the location definition and then proxy pass to http://127.0.0.1:8080 with a rewrite to get the final destination to /gui/ but I couldn't get that to work either.

Any help is appreciated. Thanks!

share|improve this question
    
Should requests to yourserver.com/whatever.js been proxied to 127.0.0.1:8080/gui/whatever.js? –  slimsuperhero Jun 26 '13 at 14:02
    
Yes. That's what needs to happen. –  astjohn Jul 12 '13 at 12:07
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.