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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T03:37:51+00:00 2026-06-14T03:37:51+00:00

Environment: uwsgi nginx django 1.3 I’m using the domain www.example.com with Django and nginx,

  • 0

Environment:

  • uwsgi
  • nginx
  • django 1.3

I’m using the domain www.example.com with Django and nginx, and I want to access the Django by www.example.com/abc/ , but I don’t know how to set the subdirectory.

This is the nginx conf file:

server {
        listen 80;
        server_name www.example.com;
        error_log /var/log/nginx/xxx.error_log info;

        root /home/web/abc;  # this is the directory of the django program

        location ~* ^.+\.(jpg|jpeg|png|gif|css|js|ico){
                root /home/web/abc;
                access_log off;
                expires 1h;
        }

        location ~ /abc/ {   # I want to bind the django program to the domian's subdirectory
                include uwsgi_params;
                uwsgi_pass 127.0.0.1:9000;
        }
}

When I open the website www.example.com/abc/, the django urls.py doesn’t match, it only match the site like ^index$.

How can I modify the nginx location to set django to www.example.com/abc?

  • 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-14T03:37:52+00:00Added an answer on June 14, 2026 at 3:37 am

    According to the uWSGI on Nginx docs, you just have to pass the SCRIPT_NAME to django.

    location /abc {
        include uwsgi_params;
        uwsgi_pass 127.0.0.1:9000;
        uwsgi_param SCRIPT_NAME /abc;            
    }
    

    Django will still “see” /abc, but it should deal with it so that it gets stripped off before your urls are matched. You want this to happen, if django didn’t see /abc, it would generate incorrect urls for your site and none of your links would work.

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

Sidebar

Related Questions

I'm currently trying to set up nginx + uWSGI server for my Django homepage.
I had no issue with Django + uWSGI + Cherokee. BUt I would like
Environment I am using the native document management integration between Microsoft Dynamics CRM 2011
Environment: WebGL, Chrome. I have the following behavior when using transparent png's as textures
Environment: I am using MS-VC++ 6.0, I include a group of header file with
Environment: Server : Jboss 4.2.3.GA We are using c3p0 0.9.1.2 for connection pooling. Whenever
Environment: WebSphere App Server / WebSphere Portal 7, fronted by IBM IHS/Apache httpd using
Environment: asp.net fx3.5 I'm using the objectdatasource for my gridview. At first, I load
Environment: Android 2.3.3 with Google API I know this is kind of long, but
Environment is Visual Studio 2012, ServiceStack, ASP.NET Web Application Project (followed https://github.com/ServiceStack/ServiceStack/wiki/Create-your-first-webservice ) Looking

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.