Unable to access sub URLs from proxied server in Nginx
up vote
0
down vote
favorite
I have a server example.com
.
On my network, I have a Node service running at 123.456.78.90:3333
.
I'm loading this at the endpoint example.com/aaa
by adding a proxy_pass to the location header of Nginx.
This has endpoints such as 123.456.78.90:3333/abc
and 123.456.78.90:3333/def/ghi
I'm successfully able to load 123.456.78.90:3333
on accessing example.com/aaa
However, control of sub URLs from the root of 123.45.67.89:3333
- /abc
and /def/ghi
are being accessed as example.com/abc
and example.com/def/ghi
How can I redirect them from example.com/aaa/abc
and example.com/aaa/def/ghi
?
This is how my Nginx configuration currently looks like
location /aaa/{
proxy_pass http://123.456.78.90:3333/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
node.js nginx reverse-proxy
add a comment |
up vote
0
down vote
favorite
I have a server example.com
.
On my network, I have a Node service running at 123.456.78.90:3333
.
I'm loading this at the endpoint example.com/aaa
by adding a proxy_pass to the location header of Nginx.
This has endpoints such as 123.456.78.90:3333/abc
and 123.456.78.90:3333/def/ghi
I'm successfully able to load 123.456.78.90:3333
on accessing example.com/aaa
However, control of sub URLs from the root of 123.45.67.89:3333
- /abc
and /def/ghi
are being accessed as example.com/abc
and example.com/def/ghi
How can I redirect them from example.com/aaa/abc
and example.com/aaa/def/ghi
?
This is how my Nginx configuration currently looks like
location /aaa/{
proxy_pass http://123.456.78.90:3333/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
node.js nginx reverse-proxy
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I have a server example.com
.
On my network, I have a Node service running at 123.456.78.90:3333
.
I'm loading this at the endpoint example.com/aaa
by adding a proxy_pass to the location header of Nginx.
This has endpoints such as 123.456.78.90:3333/abc
and 123.456.78.90:3333/def/ghi
I'm successfully able to load 123.456.78.90:3333
on accessing example.com/aaa
However, control of sub URLs from the root of 123.45.67.89:3333
- /abc
and /def/ghi
are being accessed as example.com/abc
and example.com/def/ghi
How can I redirect them from example.com/aaa/abc
and example.com/aaa/def/ghi
?
This is how my Nginx configuration currently looks like
location /aaa/{
proxy_pass http://123.456.78.90:3333/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
node.js nginx reverse-proxy
I have a server example.com
.
On my network, I have a Node service running at 123.456.78.90:3333
.
I'm loading this at the endpoint example.com/aaa
by adding a proxy_pass to the location header of Nginx.
This has endpoints such as 123.456.78.90:3333/abc
and 123.456.78.90:3333/def/ghi
I'm successfully able to load 123.456.78.90:3333
on accessing example.com/aaa
However, control of sub URLs from the root of 123.45.67.89:3333
- /abc
and /def/ghi
are being accessed as example.com/abc
and example.com/def/ghi
How can I redirect them from example.com/aaa/abc
and example.com/aaa/def/ghi
?
This is how my Nginx configuration currently looks like
location /aaa/{
proxy_pass http://123.456.78.90:3333/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
node.js nginx reverse-proxy
node.js nginx reverse-proxy
asked Nov 19 at 9:28
Febin K G
135
135
add a comment |
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53371659%2funable-to-access-sub-urls-from-proxied-server-in-nginx%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown