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 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: I am not a C programmer. I have recently seen a friend's project.
Disclaimer: this question may not have practical value, it's more of a puzzle/curiosity question.
Disclaimer: not sure this is WordPress related or not. I'm following a simple tutorial
Disclaimer : I'm quite a novice to RoR, but not with Ruby (if that
Disclaimer: This was just a silly mistake i made. Did not close it because
Disclaimer Despite the title, this is a genuine question, not an attempt at Emacs/Vi
Disclaimer: I am fairly new to working with generics so I am not entirely
Disclaimer: this is needed for an old and ugly codebase that I'd much rather
Disclaimer: please do not bother reading this long post unless you are an embedded
Disclaimer: I have already seen the following questions and their solutions did not apply

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.