SHOW:
|
|
- or go back to the newest paste.
1 | I'm using cloud9 ide, which listens on a local port @ / and I'm proxying to it via proxy_pass. I want to add a second instance, listening on another local port and to be able to use it from code.mydomain.org/myapp. My / location works perfectly, but I am stumped setting up a second proxy using a location other than /. | |
2 | ||
3 | ||
4 | server { | |
5 | listen 80; | |
6 | server_name code.mydomain.org; | |
7 | ||
8 | ||
9 | ||
10 | location / { | |
11 | proxy_pass http://localhost:3131; | |
12 | include /etc/nginx/proxy_params; | |
13 | } | |
14 | ||
15 | - | location /myapp/ { |
15 | + | location ^/myapp/ { |
16 | rewrite /myapp(.*) $1 break; | |
17 | proxy_pass http://127.0.0.1:3132; | |
18 | include /etc/nginx/proxy_params; | |
19 | } | |
20 | ||
21 | } |