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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T15:59:03+00:00 2026-06-11T15:59:03+00:00

I have a custom nginx build for my project and everything works fine except

  • 0

I have a custom nginx build for my project and everything works fine except I’m confused about serving static files using the same nginx server (below you can see my config file) recently tried to set root=/home/USERNAME/media/app/ and root= /home/USERNAME/.virtualenvs/medialaw; also created static only applications in control panel and pointed extra_info to my MEDIA_ROOT and STATIC_ROOT respectively but all things failed.

Can anyone help me with it, may be someone already faced such a challenge?

server {
    listen   MY_PORT;
    server_name USERNAME.webfactional.com;

    access_log /home/USERNAME/logs/user/nginx/app_access.log;
    error_log  /home/USERNAME/logs/user/nginx/app_error.log;

    root /home/USERNAME/.virtualenvs/medialaw;

   location /m {
        alias /home/USERNAME/media/app/media;

        if ($query_string) {
            expires max;
        }
    }

    location /s {
        alias /home/imanhodjaev/media/app/static;

        if ($query_string) {
            expires max;
         }
    }

    location / {
        proxy_pass_header Server;
        proxy_set_header Host $http_host;
        proxy_redirect off;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Scheme $scheme;
        proxy_connect_timeout 10;
        proxy_read_timeout 10;
        proxy_pass http://localhost:PORT/;
    }

    error_page 500 502 503 504 /media/50x.html;
}

I’ve posted this question recently on webfaction Q&A site
http://community.webfaction.com/questions/10535/django-141-serving-static-and-media-with-custom-nginx-build

Thanks,

Sultan

  • 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-11T15:59:04+00:00Added an answer on June 11, 2026 at 3:59 pm

    Problem resolved this is how configuration looks like so far

    Nginx

    server {
        listen   MY_PORT;
        server_name USERNAME.webfactional.com;
    
        access_log /home/USERNAME/logs/user/nginx/app_access.log;
        error_log  /home/USERNAME/logs/user/nginx/app_error.log;
    
        root /home/USERNAME/media/app;
    
        location /m {
            alias /home/USERNAME/media/app/media;
        }
    
        location /s/ {
            alias /home/imanhodjaev/media/app/static;
        }
    
        location / {
            proxy_pass_header Server;
            proxy_set_header Host $http_host;
            proxy_redirect off;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Scheme $scheme;
            proxy_connect_timeout 10;
            proxy_read_timeout 10;
            proxy_pass http://localhost:PORT/;
        }
    
        error_page 500 502 503 504 /media/50x.html;
    }
    

    Webfaction configuration from control panel

    Deleted two static only apps filled required fields and set extra_info for static and media locations respectively.

    Thanks,

    Sultan

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

Sidebar

Related Questions

We have custom headers in the Silverlight DataGrid using the ContentTemplate. We've got a
I have custom SiteMapProvider and RoleProvider that works together properly: IsAccessibleToUser returns false if
I have custom exceptions in my django project that look like this: class CustomFooError(Exception):
I have custom js/jquery code which is running fine on all browsers including IE9
I have a Rails 3.1 app running in production using Nginx and Unicorn. And
I'm running a Rails 3.0.7 app with nginx and Passenger. I have a custom
I have custom MSBuild project file with few <ProjectReferences> . I'm calling the <MSBuild
I have custom objects I am binding to using ObjectDataSource. I have three-level binding:
I have the following setup: NGINX -> Apache -> PHP scripts Apache is serving
I have custom Application class in my Android project that is properly described in

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.