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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T06:44:04+00:00 2026-06-17T06:44:04+00:00

I have Apache running on port 8097, and Nginx proxying requests to it: location

  • 0

I have Apache running on port 8097, and Nginx proxying requests to it:

location / {
    proxy_pass         http://127.0.0.1:8097;

    proxy_redirect          off;
    proxy_set_header        Host            $host;
    proxy_set_header        X-Real-IP       $remote_addr;
    proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;
    client_max_body_size    10m;
    client_body_buffer_size 128k;
    proxy_connect_timeout   90;
    proxy_send_timeout      90;
    proxy_read_timeout      90;
    proxy_buffers           32 4k;
}

Apache config (meaningful part):

    <Directory /home/some/htdocs>
            Options FollowSymLinks
            Options -Indexes
            AllowOverride All
            Order allow,deny
            allow from all
    </Directory>

So what happens: when I go to www.mysite.com/photos and there exists a directory photos Apache redirects me to this directory with slash added. But for some reason it actually redirects me to www.mysite.com:8097/photos/ I see this address in the browser, what I am actually not supposed to:

HTTP/1.1 301 Moved Permanently
Server: nginx/1.2.4
Date: Thu, 01 Nov 2012 10:28:13 GMT
Content-Type: text/html; charset=iso-8859-1
Connection: keep-alive
Location: http://www.mysite.com:8097/photos/

I know I can fix this via UseCanonicalName On (not the best solution – what if i do not have a canonical name?) But still I wonder, how it happens that the actual apache port is exposed with this kind of redirect (but all other rewrites and redirects work properly).

  • 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-17T06:44:05+00:00Added an answer on June 17, 2026 at 6:44 am

    I found a way to fix it in nginx config. One need to add port to Host header

    proxy_set_header        Host            $host:$server_port;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an apache web server running an HTTP daemon on port 80. This
I have my Apache http server running on localhost:80 and restlet server on localhost:8182,
I have a tomcat app running on http://localhost:8080/appexploded/login.jsp (Tomcat). Now I have installed Apache
I'm running Nodejs and Apache alongside each other. node-http-proxy is listening on port 80
I have currently Apache running on port 80, it has lots of domains setup.
I have an Apache server running on my machine (port 80) I have a
I have CollabNet Subversion server and client installed, running off of Apache that came
I have Sventon running on port 8090 of my server under Apache Tomcat. I
I installed XAMPP and have an apache server running. My files are located on
I have Apache Tomcat Version 7.0.26 running. A have a JAX-RS servlet under /test,

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.