nginx proxy: forward port 8080 to 80 works but generated links in webapp don't work after that The Next CEO of Stack OverflowProxy HTTPS requests to a HTTP backend with NGINXnginx redirect issue with upstream configurationNginx proxy pass works for https but not httpnginx load balancer rewrite to listen portnginx proxy redirecting request to different proxyNginx subversion commit failureNginx/Apache: set HSTS only if X-Forwarded-Proto is httpsnginx reverse proxy hide login query also on 301 redirect or full qualified urlSingle server for multiple web-apps (same domain)Nginx reverse proxy to many local servers + webserver duty
How to invert MapIndexed on a ragged structure? How to construct a tree from rules?
Does soap repel water?
Would this house-rule that treats advantage as a +1 to the roll instead (and disadvantage as -1) and allows them to stack be balanced?
How to install OpenCV on Raspbian Stretch?
How to scale a tikZ image which is within a figure environment
Tactics for judging if a printed image will be bright enough?
Is there always a complete, orthogonal set of unitary matrices?
Is there a difference between "Fahrstuhl" and "Aufzug"
Why the difference in type-inference over the as-pattern in two similar function definitions?
WOW air has ceased operation, can I get my tickets refunded?
Which one is the true statement?
What did we know about the Kessel run before the prequels?
Domestic-to-international connection at Orlando (MCO)
I believe this to be a fraud - hired, then asked to cash check and send cash as Bitcoin
Plot of histogram similar to output from @risk
Why does standard notation not preserve intervals (visually)
Prepend last line of stdin to entire stdin
How do I align (1) and (2)?
Method for adding error messages to a dictionary given a key
What is the value of α and β in a triangle?
How a 64-bit process virtual address space is divided in Linux?
Can a Bladesinger Wizard use Bladesong with a Hand Crossbow?
Do I need to write [sic] when a number is less than 10 but isn't written out?
Is it my responsibility to learn a new technology in my own time my employer wants to implement?
nginx proxy: forward port 8080 to 80 works but generated links in webapp don't work after that
The Next CEO of Stack OverflowProxy HTTPS requests to a HTTP backend with NGINXnginx redirect issue with upstream configurationNginx proxy pass works for https but not httpnginx load balancer rewrite to listen portnginx proxy redirecting request to different proxyNginx subversion commit failureNginx/Apache: set HSTS only if X-Forwarded-Proto is httpsnginx reverse proxy hide login query also on 301 redirect or full qualified urlSingle server for multiple web-apps (same domain)Nginx reverse proxy to many local servers + webserver duty
I'm trying to setup up a really simple thing:
use Nginx to listen to port 8080 and forward everything to internal host with port 80.
This is my config so far:
server
listen 8080;
server_name publichost;
location /
proxy_set_header Host $http_host;
proxy_pass http://app1;
server
listen 80;
server_name publichost;
location /
proxy_set_header Host $http_host;
proxy_pass http://app2;
So far so good. Now when I open http://publichost:8080 it works and the browser shows the index.html site.
But now, every resource link in this index.html try to load files from app2
<link rel="stylesheet" type="text/css" href="http://publichost/static/styles.css">
this totally makes sense, since the proxy forwards every requests with port 8080 to my app1 and uses internal port 80, and every request with port 80 goes to app2.
My question is: How can I configure nginx proxy, so that it just works?
I want to be able to have another webapplication that is reachable via default port 80.
nginx proxy docker
add a comment |
I'm trying to setup up a really simple thing:
use Nginx to listen to port 8080 and forward everything to internal host with port 80.
This is my config so far:
server
listen 8080;
server_name publichost;
location /
proxy_set_header Host $http_host;
proxy_pass http://app1;
server
listen 80;
server_name publichost;
location /
proxy_set_header Host $http_host;
proxy_pass http://app2;
So far so good. Now when I open http://publichost:8080 it works and the browser shows the index.html site.
But now, every resource link in this index.html try to load files from app2
<link rel="stylesheet" type="text/css" href="http://publichost/static/styles.css">
this totally makes sense, since the proxy forwards every requests with port 8080 to my app1 and uses internal port 80, and every request with port 80 goes to app2.
My question is: How can I configure nginx proxy, so that it just works?
I want to be able to have another webapplication that is reachable via default port 80.
nginx proxy docker
Useproxy_redirect, e.g.proxy_redirect http://localhost:8080 http://app2;and don't forget your trailing slashes inproxy_pass(I think you need them in your config)
– Lenniey
yesterday
proxy_redirectonly rewrites response headers, it does not touch the response body. The proper fix is to fix the misbehaving web application.
– Michael Hampton♦
yesterday
You can usesub_filterto modify the response body, but it's not a scalable solution.
– Richard Smith
yesterday
add a comment |
I'm trying to setup up a really simple thing:
use Nginx to listen to port 8080 and forward everything to internal host with port 80.
This is my config so far:
server
listen 8080;
server_name publichost;
location /
proxy_set_header Host $http_host;
proxy_pass http://app1;
server
listen 80;
server_name publichost;
location /
proxy_set_header Host $http_host;
proxy_pass http://app2;
So far so good. Now when I open http://publichost:8080 it works and the browser shows the index.html site.
But now, every resource link in this index.html try to load files from app2
<link rel="stylesheet" type="text/css" href="http://publichost/static/styles.css">
this totally makes sense, since the proxy forwards every requests with port 8080 to my app1 and uses internal port 80, and every request with port 80 goes to app2.
My question is: How can I configure nginx proxy, so that it just works?
I want to be able to have another webapplication that is reachable via default port 80.
nginx proxy docker
I'm trying to setup up a really simple thing:
use Nginx to listen to port 8080 and forward everything to internal host with port 80.
This is my config so far:
server
listen 8080;
server_name publichost;
location /
proxy_set_header Host $http_host;
proxy_pass http://app1;
server
listen 80;
server_name publichost;
location /
proxy_set_header Host $http_host;
proxy_pass http://app2;
So far so good. Now when I open http://publichost:8080 it works and the browser shows the index.html site.
But now, every resource link in this index.html try to load files from app2
<link rel="stylesheet" type="text/css" href="http://publichost/static/styles.css">
this totally makes sense, since the proxy forwards every requests with port 8080 to my app1 and uses internal port 80, and every request with port 80 goes to app2.
My question is: How can I configure nginx proxy, so that it just works?
I want to be able to have another webapplication that is reachable via default port 80.
nginx proxy docker
nginx proxy docker
edited 4 hours ago
artgrohe
asked yesterday
artgroheartgrohe
1368
1368
Useproxy_redirect, e.g.proxy_redirect http://localhost:8080 http://app2;and don't forget your trailing slashes inproxy_pass(I think you need them in your config)
– Lenniey
yesterday
proxy_redirectonly rewrites response headers, it does not touch the response body. The proper fix is to fix the misbehaving web application.
– Michael Hampton♦
yesterday
You can usesub_filterto modify the response body, but it's not a scalable solution.
– Richard Smith
yesterday
add a comment |
Useproxy_redirect, e.g.proxy_redirect http://localhost:8080 http://app2;and don't forget your trailing slashes inproxy_pass(I think you need them in your config)
– Lenniey
yesterday
proxy_redirectonly rewrites response headers, it does not touch the response body. The proper fix is to fix the misbehaving web application.
– Michael Hampton♦
yesterday
You can usesub_filterto modify the response body, but it's not a scalable solution.
– Richard Smith
yesterday
Use
proxy_redirect, e.g. proxy_redirect http://localhost:8080 http://app2; and don't forget your trailing slashes in proxy_pass (I think you need them in your config)– Lenniey
yesterday
Use
proxy_redirect, e.g. proxy_redirect http://localhost:8080 http://app2; and don't forget your trailing slashes in proxy_pass (I think you need them in your config)– Lenniey
yesterday
proxy_redirect only rewrites response headers, it does not touch the response body. The proper fix is to fix the misbehaving web application.– Michael Hampton♦
yesterday
proxy_redirect only rewrites response headers, it does not touch the response body. The proper fix is to fix the misbehaving web application.– Michael Hampton♦
yesterday
You can use
sub_filter to modify the response body, but it's not a scalable solution.– Richard Smith
yesterday
You can use
sub_filter to modify the response body, but it's not a scalable solution.– Richard Smith
yesterday
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "2"
;
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',
autoActivateHeartbeat: false,
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
);
);
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%2fserverfault.com%2fquestions%2f960608%2fnginx-proxy-forward-port-8080-to-80-works-but-generated-links-in-webapp-dont-w%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Server Fault!
- 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%2fserverfault.com%2fquestions%2f960608%2fnginx-proxy-forward-port-8080-to-80-works-but-generated-links-in-webapp-dont-w%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
Use
proxy_redirect, e.g.proxy_redirect http://localhost:8080 http://app2;and don't forget your trailing slashes inproxy_pass(I think you need them in your config)– Lenniey
yesterday
proxy_redirectonly rewrites response headers, it does not touch the response body. The proper fix is to fix the misbehaving web application.– Michael Hampton♦
yesterday
You can use
sub_filterto modify the response body, but it's not a scalable solution.– Richard Smith
yesterday