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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T23:58:28+00:00 2026-06-11T23:58:28+00:00

I have a follow up question from my original Django serving question which was

  • 0

I have a follow up question from my original Django serving question which was how to develop Django apps and serve them from the same server as my main PHP-based site (all part of a larger migration of my website from a static and PHP driven one to a series of Django apps).

I couldn’t quite use the name server solution I was provided with, and instead just deployed my Django applications on a different port (8000) using mod_wsgi. Now, however, I need to actually integrate the Django application into the main site. In my Apache 2.0 configuration file (for say http://www.example.com) I added the following ProxyPass commands (after my mod_wsgi initialization):

ProxyPass        /app/newsletter     http://www.example.com:8000/app/newsletter
ProxyPassReverse /app/newsletter     http://www.example.com:8000/app/newsletter

Here I expect that any request to:

http://www.example.com/app/newsletter

will get successfully proxied to:

http://www.example.com:8000/app/newsletter

and all will be right with the world.

However, this is not the case. Apache hangs for 5 or so minutes (the time taken to craft this question) then spits out a 502 Proxy Error:

Proxy Error

The proxy server received an invalid response from an upstream server.
The proxy server could not handle the request GET /app/newsletter/.

Reason: Error reading from remote server

Watching my Apache 2.0 error log after this response I see continuous errors like the following:

[Thu Sep 27 15:25:49 2012] [error] Exception KeyError: KeyError(****,) in <module 'threading' from '/usr/lib64/python2.6/threading.pyc'> ignored

So something seems to be remiss in either how mod_proxy plays with Django and/or Python. I have other Java related processes that I use ProxyPass and ProxyPassReverse on and they work fine. Also, when I don’t try to apply the ProxyPass the Django apps all work well (ie. when I address them on port 8000 directly).

Any ideas? I don’t feel like what I am doing is particularly complex.

Thanks in advance.

  • 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-11T23:58:29+00:00Added an answer on June 11, 2026 at 11:58 pm

    In the end, using mod_rewrite was the solution. Added this to Apache’s httpd.conf file:

    RewriteEngine On
    RewriteRule ^/app/newsletter/(.*)$ http://%{SERVER_NAME}:8000%{REQUEST_URI} [P]
    

    Everything works as expected.

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

Sidebar

Related Questions

Kind of a follow up to a question from yesterday. I have a hash
This is a follow up from my previous question I have this code basically
This is a follow up question from here . I have some output and
I have a follow-up question to this one . I created a new form,
I have a follow up question to this question . Is it possible to
I have a follow up question to this one . Now that I have
I have a follow-up question regarding an issue I previously had on SO here
I have the follow structure (example): trunk/ branches/v1.0.0 branches/v1.0.1 tags/v1.0.0 My question is: The
this is a follow-up question of mine. Suppose now I have a URL :
As a follow up to this question , I have a parent entity that

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.