Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6072569
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T10:10:28+00:00 2026-05-23T10:10:28+00:00

I have a server configured to host multiple node.js+express apps on multiple domains through

  • 0

I have a server configured to host multiple node.js+express apps on multiple domains through an Ngnix frontend. Everything works great, except for when calls to redirect are made from an express route:

res.redirect('/admin');

Then the client browser is redirected to http://0.0.0.0:8090

It seems like it must be an issue with the redirection headers coming out of express, but just in case it’s relevant, here’s the nginx.conf file for the domain in question:

server {
    listen 0.0.0.0:80;
    server_name  *.example.com;

    access_log  /var/log/nginx_example_access.log;
    error_log  /var/log/nginx_example_error.log debug;

    # proxy to node
    location / {
        proxy_pass         http://0.0.0.0:8090/;
        proxy_redirect     off;

        proxy_set_header   Host             $proxy_host;
        proxy_max_temp_file_size 0;

        client_max_body_size       10m;
        client_body_buffer_size    128k;

        proxy_connect_timeout      90;
        proxy_send_timeout         90;
        proxy_read_timeout         90;

        proxy_buffer_size          4k;
        proxy_buffers              4 32k;
        proxy_busy_buffers_size    64k;
        proxy_temp_file_write_size 64k;
    }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T10:10:29+00:00Added an answer on May 23, 2026 at 10:10 am

    Solved. I had a problem in my nginx conf file that was causing node/express to receive the wrong request-header. When a relative path is passed into res.redirect, it pulls the Host from the incoming req object and sets it in the response-header.

            proxy_set_header   Host             $proxy_host;
    

    should have been

            proxy_set_header   Host             $host;
    

    $proxy_host is the upstream host address 0.0.0.0:port

    $host is the incoming request-header Host example.com


    UPDATE

    As Louis Chatriot points out in the comments, newer versions of Nginx have replaced $host with $http_host, which in previous versions returns example.com:port but now returns example.com.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

A single Biztalk Server can have multiple Host processes. Is it possible to create
I have URLs of the form http://domain/image/⟨uuid⟩/42x42/some_name.png . The Web server (nginx) is configured
I have two MySQL servers configured in a Master-Slave relationship. Master -> my.cnf: server-id=1283522287
I have configured and running SmarterEmail server, running SMTP service for 25 port, configured
I have configured Tomcat 6 to serve Perl CGI scripts. That part is well
The Weblogic servers we are using have been configured to allow JNDI datasource names
What steps do I have to take to configure my sendmail server to implement
My requirement is I have server J2EE web application and client J2EE web application.
I have a server running Gentoo 2.6.12 r6 and I want to run Apache
I have a server that sends data via a socket, the data is a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.