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,










share|improve this question




















  • 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










  • 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















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,










share|improve this question




















  • 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










  • 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













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,










share|improve this question















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






share|improve this question















share|improve this question













share|improve this question




share|improve this question








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 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












  • 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




    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












  • 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

















active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














 

draft saved


draft discarded


















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





































active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes
















 

draft saved


draft discarded



















































 


draft saved


draft discarded














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




















































































Popular posts from this blog

Schultheiß

Liste der Kulturdenkmale in Wilsdruff

Android Play Services Check