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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T01:04:07+00:00 2026-05-25T01:04:07+00:00

I have an application with both dynamic and static content. I use nginx as

  • 0

I have an application with both dynamic and static content. I use nginx as a front end for this app. When dynamic content is requested, the request is forwarded to an unix socket (to a node.js app), this part works well. I have added a “location” directive to serve the static content but this part does not work, I get the 404 error each time despite the fact the folder “/home/test/my_app/static” does exist.

This is the nginx conf I have:

upstream test_sock {
   server unix:/tmp/test.sock
   fail_timeout=0;
}

server {
   listen 15000;
   client_max_body_size 4G;
   server_name localhost domain.com;

   keepalive_timeout 5;

   location ~ /static/ {
      if (!-f $request_filename) {
         return 404;
      }
      if (-f $request_filename) {
         root    /home/test/my_app/static;
         expires 30d;
      }
   }

  location / {
     proxy_pass http://test_sock;
     proxy_redirect off;
     proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
     proxy_set_header Host $http_host;
  }
}

Any idea ?

  • 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-25T01:04:08+00:00Added an answer on May 25, 2026 at 1:04 am

    hmmm… ok, silly thing, I was missing the root directive before the locations ones…

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

Sidebar

Related Questions

Suppose you have two seperate ASP.NET Web Application projects that both need to use
I have this application that has dynamic language switching built in. Based on the
We have an application written in both C++ and .NET that installs for all
I have a web application which contains both secure (SSL) and non-secure pages. A
We have an application we're trying to deploy on both 64 bit and 32
We have two tables in our application that both have a ShowOrder column. We
My Situation: I have 1 asp.net application with both aspx pages AND webservices I
I have a web application that is using both jQuery 1.2.6 and YUI 2.6.0
We have a WPF Application that runs from both desktop and as a XBAP
I have a struts2 web application which accepts both POST and GET requests 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.