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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T20:27:06+00:00 2026-05-21T20:27:06+00:00

I have a number of PHP sites running on Apache, however I am about

  • 0

I have a number of PHP sites running on Apache, however I am about to launch my first Django site.
I have successfully got WSGI working on Apache to handle the Python scripts but I am a bit stuck with using Nginx to serve my media files.

I know I need to make Apache listen on a different port and get Nginx to listen on port 80, then forward any non-media requests to Apache on port 8080.

What I really want to know is, is there an easy way to configure it to work with all of my existing sites or do I need to set up a separate record for every one of my current sites just to forward the requests to port 8080?

Any advice appreciated.

Thanks

  • 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-21T20:27:07+00:00Added an answer on May 21, 2026 at 8:27 pm

    If you scroll down a bit in the Django documentation about serving static files, they give you the information on how to make Apache serve the files for you so that you don’t need nginx (assumes your media files are in /usr/local/wsgi/static/media/):

    Alias /robots.txt /usr/local/wsgi/static/robots.txt
    Alias /favicon.ico /usr/local/wsgi/static/favicon.ico
    
    AliasMatch ^/([^/]*\.css) /usr/local/wsgi/static/styles/$1
    
    Alias /media/ /usr/local/wsgi/static/media/
    
    <Directory /usr/local/wsgi/static>
        Order deny,allow
        Allow from all
    </Directory>
    
    WSGIScriptAlias / /usr/local/wsgi/scripts/django.wsgi
    
    <Directory /usr/local/wsgi/scripts>
        Order allow,deny
        Allow from all
    </Directory>
    

    If, however, you are dead set on using nginx, you would add your static directives in your server {} directive:

    location /media/ {
        access_log off; # who cares about static files?
        alias /usr/local/wsgi/static/media/;
        expires 30d; # enables caching.
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have basic idea about running PHP in different configurations like mod_php, cgi, FastCGI,
On a website I have a number of small PHP scripts to automate changes
I am trying to dial a phone number from php (i have a client
I have a significant number of object libraries written for PHP 5.2.5, and I'm
I have a PHP function that takes a variable number of arguments (using func_num_args()
I have a php form that has a known number of columns (ex. top
I have a checkbox list generated using php depending upon number of coloumns in
I have a url like www.example.com/mypage.php?id=324 That number 324 is auto incremented (meaning that
I'm working with a closed community site (PHP-based) of about 100 users, and one
I am using the comet long-polling technique with apache, php, jquery. I've got a

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.