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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T23:55:37+00:00 2026-05-20T23:55:37+00:00

As the title described, Django keeps changing my URL from /localhost/ to /127.0.0.1:8080/ which

  • 0

As the title described, Django keeps changing my URL from /localhost/ to /127.0.0.1:8080/ which keeps messing up my serving static files by Nginx. Any ideas why its doing this? Thanks!

/**EDIT**/
Here is the Nginx configuration:

server {

    listen   80; ## listen for ipv4
    listen   [::]:80 default ipv6only=on; ## listen for ipv6

    server_name  localhost;

    access_log  /var/log/nginx/localhost.access.log;

    location ~* ^.+\.(jpg|jpeg|gif|png|ico|css|zip|tgz|gz|rar|bz2|pdf|txt|tar|wav|bmp|rtf|js|flv|swf|html|htm)$
    {
            root   /srv/www/testing;
    }

    location / {
            proxy_pass         http://127.0.0.1:8080/;
            proxy_redirect     off;
    }

    location /doc {
        root   /usr/share;
        autoindex on;
        allow 127.0.0.1;
        deny all;
    }

    location /images {
        root   /usr/share;
        autoindex on;
    }

Here is Apache config file:

<VirtualHost *:8080>

    ServerName testing
    DocumentRoot /srv/www/testing

    <Directory /srv/www/testing>
        Order allow,deny
        Allow from all
    </Directory>

    WSGIScriptAlias / /srv/www/testing/apache/django.wsgi

</VirtualHost>
  • 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-20T23:55:37+00:00Added an answer on May 20, 2026 at 11:55 pm

    edit2:

    http://wiki.nginx.org/HttpProxyModule#proxy_redirect

    http://wiki.nginx.org/HttpProxyModule#proxy_pass

    What I think is happening is when you use your httpresponseredirect, the HTTP_HOST header is giving it the 127.0.0.1:8080, because of your proxy_pass setting.

    Django's HttpResponseRedirect seems to strip off my subdomain?

    Django has some methods it always
    applies to a response. One of these is
    django.utils.http.fix_location_header.
    This ensures that a redirection
    response always contains an absolute
    URI (as required by HTTP spec).

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

Sidebar

Related Questions

Like described in the title, is there some library in the Microsoft framework which
As the title described, how to use c library function fgets in assembly language?
As described in the title I would like to develop a Windows Forms Application
I am trying set up databinding as described in the title. The problem I
As title described, I integrated iAd into my iPhone apps. Everything worked fine in
As what described in title. Thank you!
I have a problem as i've described in title. I've got menu and I
I want to get html content from a url and parse the html content
As described in the title, I have an app with two UILabels under each
I got a problem described in the title. My selectOneMenu doesn't change my Value

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.