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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T14:20:32+00:00 2026-06-06T14:20:32+00:00

On my local test machine it works fine, but on the server it will

  • 0

On my local test machine it works fine, but on the server it will double GET parameters.

For example, with this code:

return redirect('/add?c='+str(rm.id))

I end up at /add?c=3423?c=3423 for example.

And

return redirect('/add?success')

Gets me to /add?success?success

Does anyone know what’s up?

EDIT: Here’s my relevant line of urls.py and my nginx config

url(r'^add/$', 'rumors.views.add'),

server{
    listen 0.0.0.0:443 ssl;
    server_name www.****.com ****.com;
    ssl_certificate     /opt/etc/***;
    ssl_certificate_key /opt/etc/***;

    keepalive_timeout 70;
    access_log /var/log/nginx/access.log;
    error_log /var/log/nginx/error.log;

    location / {
        auth_basic "Restricted";
        auth_basic_user_file /opt/etc/.htpasswd;
        uwsgi_pass   unix:///tmp/uwsgi_***.sock;
        include        uwsgi_params;
    }

    location /static {
            # Point this wherever the static files for your django app are stored (i.e. MEDIA_ROOT)
            alias /opt/apps/****/static;
    }

}
server {
listen 80 default_server;
server_name "";


location / {
    rewrite ^ https://****.com$request_uri permanent;
}
}
  • 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-06T14:20:33+00:00Added an answer on June 6, 2026 at 2:20 pm

    A random stab at this, without knowing enough info yet…

    Its possible that what is happening, is the first request goes through the web server and on to django. Django redirects to a new url with query string, and then the request goes back through the webserver again. At that point, I think the web server is splitting up the pattern improperly. Normally when I see this, the webserver wants to see a trailing slash on the pattern to inform it that it should treat the entire url pattern raw:

    So try this maybe (adding trailing slash):

    return redirect('/add/?c='+str(rm.id))
    
    return redirect('/add/?success')
    

    Other than this, you might need to go into more detail about your production web server.

    If your production server really is performing the redirect, and not django, then you should definitely look into making sure the trailing slash is present in the rule.

    Update: Based on the added nginx conf

    I think your problem might be your rewrite rule for https. Its quite possibly re-appending the query string because of a single missing ?

    http://wiki.nginx.org/HttpRewriteModule

    If in the line of replacement arguments are indicated, then the rest
    of the request arguments are appended to them. To avoid having them
    appended, place a question mark as the last character:

    rewrite ^/users/(.*)$ /show?user=$1? last;

    Try making this change in your nginx conf:

    location / {
        rewrite ^ https://****.com$request_uri? permanent;
    }
    

    Lastly, just to address your comment about the behavior of your https redirect, I think you might want to adjust that as well. I actually do something almost exactly the same on one of my servers. But I make the ssl server default, and I don’t use a location directive in the port 80 server:

    server {
            server_name www.foo.com foo.com;
            rewrite ^ https://$host$request_uri? permanent; 
    }
    
    server {
            listen 443 default_server ssl;
            ...
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an ASP.NET MVC project that works fine on my local machine (no
My app (winforms .net 2.0 / vs2008) works fine on my dev machine but
I'm hosting my project in a test server (proyectos.legendsoft.com.ve), but since i need this
When I run my WCF service on my local machine, it works fine. When
Bootstrap's popover works perfectly on my local machine but doesn't seem to work on
What is the easiest way to setup a test environment on my local machine
I'm indexing a model with xapian/haystack. When i test it on my local machine
I'm remotely running a JUnit test suite with Ant from my local machine to
I'm trying to create a key like this _winreg.CreateKey(_winreg.HKEY_LOCAL_MACHINE, 'Software\\Microsoft\\Shared Tools\\MSCONFIG\\startupreg\\test\\') and the key
#1 Lua: local test = Test(); #2 C: //creating lua's test luaL_newmetatable(L, someTable); lua_userdata

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.