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 8229263
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T16:44:30+00:00 2026-06-07T16:44:30+00:00

I have nginx configured to proxy https traffic to an http server running on

  • 0

I have nginx configured to proxy https traffic to an http server running on the same machine.

Everything works fine when I configure nginx to listen on / proxy from https port 443. But I really want to listen on a non standard port. When I configure a non standard port, nginx receives the request and sends it to my http server, as it should, but the server is responding with an HTTP redirect back to the browser that tells it to redirect to ‘https://server.com/someurl”. I mean the redirect url looks good except for it’s missing the correct port. Am I missing an HTTP header that I need to be setting in the proxy?

Specifically I’m running an http instance of Tracks; http://getontracks.org. If it matters.

My (working on standard port) nginx server configuration:

location /{
    proxy_pass http://localhost:50000;
    proxy_next_upstream error timeout invalid_header http_500 http_502 http_503;
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto https;
    proxy_redirect off;
}
  • 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-06-07T16:44:33+00:00Added an answer on June 7, 2026 at 4:44 pm

    The issue stems from the line –

    proxy_set_header Host $host;
    

    Your web server(WEBrick) in turn is including this when issuing the redirect response.

    You can change it to include the non-standard port –

    proxy_set_header Host $host:$server_port;
    

    which should resolve this.

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

Sidebar

Related Questions

I have URLs of the form http://domain/image/⟨uuid⟩/42x42/some_name.png . The Web server (nginx) is configured
I have installed Nginx 1.2.0 with Passenger on my Mac Mini running Lion Server.
I have running nginx on my server ansel.ms and a node.js app on ansel.ms:46156.
I am setting up an infrastructure where I have an nginx web server configured
I've configured nginx with php-fpm on Ubuntu (and everything works pretty well). One thing
I have multiple Django projects running on one server using gunicorn and nginx .
Hi I have configured Awstats on my ubuntu machine to analyze nginx access logs
I have an NGINX server with fastcgi/PHP running on it. I need to add
I have nginx installed with gzip_static activated. It works fine for CSS and JavaScript
I have nginx setup, acting as a reverse proxy to apache. However, I need

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.