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

  • Home
  • SEARCH
  • 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 6809537
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T20:05:53+00:00 2026-05-26T20:05:53+00:00

Disclaimer: I’m working in a project where exist an huge webapp that have an

  • 0

Disclaimer:

I’m working in a project where exist an “huge” webapp that have an api for mobiles, so change the api is not an option.

This application was developed time ago and several developers have worked on it,

Having said that, the problem is this;

In the api for mobile of this site (just views than returns json data), the code is looking for a token but does in the headers of request:

token = request.META.get('HTTP_TOKEN')

When I test this api locally, works fine, but in production doesn’t, so, I try to figure out whats going on and found this:

django converts headers, even custom headers to keys in request.META, I use urllib2 and requests for test the api and the problem in production is that in production server the request.META never has a key called HTTP_TOKEN, so, doing a little of debug I seriously think the problem is the way we serve the django application.

We are using django1.3, nginx, gunicorn, virtualenvwrapper, python2.7.

My prime suspect is nginx, I think, in someway nginx receive the header but don’ forward it to django, I try to do some research about this, but I only found infor about security headers and custom headers from nginx, but I dont find doc or something about how to tell nginx that allows that header and don’t remove it.

I need help here, the first thing is test if nginx receives the header, but I just know a little about nginx and I don’t know how to tell it to log the headers of requests.

Thanks

Update

nginx conf file

  • 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-26T20:05:54+00:00Added an answer on May 26, 2026 at 8:05 pm

    If Django is accessed using uwsgi_pass, then in the appropriate location(s) …

    # All request headers should be passed on by default     
    # Make sure "Token" response header is passed to user 
    uwsgi_pass_header  Token;
    

    If Django is accessed using fastcgi_pass, then in the appropriate location(s) …

    # All request headers should be passed on by default     
    # Make sure "Token" response header is passed to user 
    fastcgi_pass_header  Token;
    

    If Django is accessed using proxy_pass, then in the appropriate location(s) …

    # All request headers should be passed on by default
    # but we can make sure "Token" request header is passed to Django 
    proxy_set_header Token $http_token;
    
    # Make sure "Token" response header is passed to user 
    proxy_pass_header  Token;
    

    These should help eliminate the possibility that Nginx is not passing things along from your issue.

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

Sidebar

Related Questions

Disclaimer : This is for a semester project that I am currently working on.
Disclaimer, I'm not a PHP programmer, so you might find this question trivial. That's
( Disclaimer: This question is not specific to ASP.NET) I have a control which
Disclaimer: This is not actually a programming question, but I feel the audience on
Disclaimer: the following is a sin against XML. That's why I'm trying to change
Disclaimer: This is for a homework assignment, but the question is not regarding the
Disclaimer This is not strictly a programming question, but most programmers soon or later
Disclaimer: JS novice I have a JS widget that depends on JQuery. The widget's
Disclaimer: I'm completely clueless about .net and COM. I have a vendor's application that
Disclaimer, I not do anything in particular with regards this question, just curious. Is

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.