Nginx proxy pass(rewrite/ redirect) to specific page on app server
up vote
0
down vote
favorite
Currently,
https:// example.com
proxy_pass
port 8080
via Nginx to : https:// example.com/app/index.py
Configuration file :
location / {
proxy_ignore_client_abort on;
proxy_pass https://ip_address_app:8080/;
/app/index.py
is default loading page on application server.
Now, I would like to rewrite/ redirect or proxy_pass to non-default loading page from :
https:// example.com -- > Nginx --> https:// example.com/app/xyz.py
I have tried rewrite
, proxy_redirect
and proxy_pass
but it didnot work as expect.
I dont have permission to change anything on app server.
Please advise.
Thank you,
nginx proxy url-rewriting reverse-proxy proxypass
|
show 5 more comments
up vote
0
down vote
favorite
Currently,
https:// example.com
proxy_pass
port 8080
via Nginx to : https:// example.com/app/index.py
Configuration file :
location / {
proxy_ignore_client_abort on;
proxy_pass https://ip_address_app:8080/;
/app/index.py
is default loading page on application server.
Now, I would like to rewrite/ redirect or proxy_pass to non-default loading page from :
https:// example.com -- > Nginx --> https:// example.com/app/xyz.py
I have tried rewrite
, proxy_redirect
and proxy_pass
but it didnot work as expect.
I dont have permission to change anything on app server.
Please advise.
Thank you,
nginx proxy url-rewriting reverse-proxy proxypass
1
In your current configuration, how does/
become/app/index.py
? Does the application server take care of that? The solution may be as simple as addinglocation = / { rewrite ^ /app/xyz.py last; }
to your existing Nginx configuration.
– Richard Smith
2 hours ago
yes, but just checked your solution, ut gotInternal Server error
– Thanh Nguyen Van
2 hours ago
Is there an error log entry?
– Richard Smith
2 hours ago
2018/11/08 17:07:31 [warn] 7743#7743: *584740 an upstream response is buffered to a temporary file /var/cache/nginx/proxy_temp/8/72/0000020728 while reading upstream, client: 115.79.137.201, server: example.com, request: "GET /app/getBackgroundImage.do HTTP/1.1", upstream: "https://ip_address_app:8080/app/getBackgroundImage.do", host: "example.com", referrer: "https://example.com/app/index.py"
– Thanh Nguyen Van
2 hours ago
That's a warning - are there no errors?
– Richard Smith
2 hours ago
|
show 5 more comments
up vote
0
down vote
favorite
up vote
0
down vote
favorite
Currently,
https:// example.com
proxy_pass
port 8080
via Nginx to : https:// example.com/app/index.py
Configuration file :
location / {
proxy_ignore_client_abort on;
proxy_pass https://ip_address_app:8080/;
/app/index.py
is default loading page on application server.
Now, I would like to rewrite/ redirect or proxy_pass to non-default loading page from :
https:// example.com -- > Nginx --> https:// example.com/app/xyz.py
I have tried rewrite
, proxy_redirect
and proxy_pass
but it didnot work as expect.
I dont have permission to change anything on app server.
Please advise.
Thank you,
nginx proxy url-rewriting reverse-proxy proxypass
Currently,
https:// example.com
proxy_pass
port 8080
via Nginx to : https:// example.com/app/index.py
Configuration file :
location / {
proxy_ignore_client_abort on;
proxy_pass https://ip_address_app:8080/;
/app/index.py
is default loading page on application server.
Now, I would like to rewrite/ redirect or proxy_pass to non-default loading page from :
https:// example.com -- > Nginx --> https:// example.com/app/xyz.py
I have tried rewrite
, proxy_redirect
and proxy_pass
but it didnot work as expect.
I dont have permission to change anything on app server.
Please advise.
Thank you,
nginx proxy url-rewriting reverse-proxy proxypass
nginx proxy url-rewriting reverse-proxy proxypass
edited 2 hours ago
asked 5 hours ago
Thanh Nguyen Van
1,0111921
1,0111921
1
In your current configuration, how does/
become/app/index.py
? Does the application server take care of that? The solution may be as simple as addinglocation = / { rewrite ^ /app/xyz.py last; }
to your existing Nginx configuration.
– Richard Smith
2 hours ago
yes, but just checked your solution, ut gotInternal Server error
– Thanh Nguyen Van
2 hours ago
Is there an error log entry?
– Richard Smith
2 hours ago
2018/11/08 17:07:31 [warn] 7743#7743: *584740 an upstream response is buffered to a temporary file /var/cache/nginx/proxy_temp/8/72/0000020728 while reading upstream, client: 115.79.137.201, server: example.com, request: "GET /app/getBackgroundImage.do HTTP/1.1", upstream: "https://ip_address_app:8080/app/getBackgroundImage.do", host: "example.com", referrer: "https://example.com/app/index.py"
– Thanh Nguyen Van
2 hours ago
That's a warning - are there no errors?
– Richard Smith
2 hours ago
|
show 5 more comments
1
In your current configuration, how does/
become/app/index.py
? Does the application server take care of that? The solution may be as simple as addinglocation = / { rewrite ^ /app/xyz.py last; }
to your existing Nginx configuration.
– Richard Smith
2 hours ago
yes, but just checked your solution, ut gotInternal Server error
– Thanh Nguyen Van
2 hours ago
Is there an error log entry?
– Richard Smith
2 hours ago
2018/11/08 17:07:31 [warn] 7743#7743: *584740 an upstream response is buffered to a temporary file /var/cache/nginx/proxy_temp/8/72/0000020728 while reading upstream, client: 115.79.137.201, server: example.com, request: "GET /app/getBackgroundImage.do HTTP/1.1", upstream: "https://ip_address_app:8080/app/getBackgroundImage.do", host: "example.com", referrer: "https://example.com/app/index.py"
– Thanh Nguyen Van
2 hours ago
That's a warning - are there no errors?
– Richard Smith
2 hours ago
1
1
In your current configuration, how does
/
become /app/index.py
? Does the application server take care of that? The solution may be as simple as adding location = / { rewrite ^ /app/xyz.py last; }
to your existing Nginx configuration.– Richard Smith
2 hours ago
In your current configuration, how does
/
become /app/index.py
? Does the application server take care of that? The solution may be as simple as adding location = / { rewrite ^ /app/xyz.py last; }
to your existing Nginx configuration.– Richard Smith
2 hours ago
yes, but just checked your solution, ut got
Internal Server error
– Thanh Nguyen Van
2 hours ago
yes, but just checked your solution, ut got
Internal Server error
– Thanh Nguyen Van
2 hours ago
Is there an error log entry?
– Richard Smith
2 hours ago
Is there an error log entry?
– Richard Smith
2 hours ago
2018/11/08 17:07:31 [warn] 7743#7743: *584740 an upstream response is buffered to a temporary file /var/cache/nginx/proxy_temp/8/72/0000020728 while reading upstream, client: 115.79.137.201, server: example.com, request: "GET /app/getBackgroundImage.do HTTP/1.1", upstream: "https://ip_address_app:8080/app/getBackgroundImage.do", host: "example.com", referrer: "https://example.com/app/index.py"
– Thanh Nguyen Van
2 hours ago
2018/11/08 17:07:31 [warn] 7743#7743: *584740 an upstream response is buffered to a temporary file /var/cache/nginx/proxy_temp/8/72/0000020728 while reading upstream, client: 115.79.137.201, server: example.com, request: "GET /app/getBackgroundImage.do HTTP/1.1", upstream: "https://ip_address_app:8080/app/getBackgroundImage.do", host: "example.com", referrer: "https://example.com/app/index.py"
– Thanh Nguyen Van
2 hours ago
That's a warning - are there no errors?
– Richard Smith
2 hours ago
That's a warning - are there no errors?
– Richard Smith
2 hours ago
|
show 5 more comments
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
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
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53203331%2fnginx-proxy-passrewrite-redirect-to-specific-page-on-app-server%23new-answer', 'question_page');
}
);
Post as a guest
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
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
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
1
In your current configuration, how does
/
become/app/index.py
? Does the application server take care of that? The solution may be as simple as addinglocation = / { rewrite ^ /app/xyz.py last; }
to your existing Nginx configuration.– Richard Smith
2 hours ago
yes, but just checked your solution, ut got
Internal Server error
– Thanh Nguyen Van
2 hours ago
Is there an error log entry?
– Richard Smith
2 hours ago
2018/11/08 17:07:31 [warn] 7743#7743: *584740 an upstream response is buffered to a temporary file /var/cache/nginx/proxy_temp/8/72/0000020728 while reading upstream, client: 115.79.137.201, server: example.com, request: "GET /app/getBackgroundImage.do HTTP/1.1", upstream: "https://ip_address_app:8080/app/getBackgroundImage.do", host: "example.com", referrer: "https://example.com/app/index.py"
– Thanh Nguyen Van
2 hours ago
That's a warning - are there no errors?
– Richard Smith
2 hours ago