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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T14:16:29+00:00 2026-05-27T14:16:29+00:00

I am currently working on a project using the Express framework. I have a

  • 0

I am currently working on a project using the Express framework. I have a directory “/static”, from which I’d like to serve static js and css files.

The project directory structure is as follows:

/
  visits.js
  /static
    /css
      style.css
    /js
      jquery.flot.js
  /views

In the app configuration, I am setting up the static file server with the following:

app.configure(function(){
    app.use(express.logger());
    app.use(express.static(__dirname + '/static'));
    app.set('views', __dirname + '/views');
    app.set('view options', { layout : true });
    app.set('view engine', 'jade');
});

When I run the app on my local machine, everything works great. My network console shows:

GET http://myserver.com/ [HTTP/1.1 200 OK 13ms]
GET http://myserver.com/css/style.css [HTTP/1.1 200 OK 3ms]
GET http://myserver.com/js/jquery.flot.js [HTTP/1.1 200 OK 4ms] 

However, when I push the same application up to my test server, the static files are not found (404 errors):

GET http://myserver.com/visits/ [HTTP/1.1 200 OK 195ms]
GET http://myserver.com/css/style.css [HTTP/1.1 404 Not Found 95ms]
GET http://myserver.com/js/jquery.flot.js [HTTP/1.1 404 Not Found 93ms]

The only difference that I can think of is on my local machine, I simply access the application at:

127.0.0.1:4000/

But on the test server, I have the app sitting behind an nginx server. I use a proxy_pass that forwards requests to:

myserver.com/visits/

I’m wondering if the forwarding is affecting the path that the static file server is using to look up the css and js files?

Any ideas / help would be greatly 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-27T14:16:30+00:00Added an answer on May 27, 2026 at 2:16 pm

    After further investigation, this was an issue with my use of proxy_pass in the nginx configuration. The initial GET request was being properly forwarded to my Express app, but the subsequent calls for css or js files was not being properly routed. This is not an issue with the Express framework. Thanks for looking.

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

Sidebar

Related Questions

I'm working on a project that is currently using the Zend Framework 1.7.6, however
I'm currently working on a project which is using EF Code First with POCOs.
I'm currently working on a project which is using EF Code First with POCOs.
Currently I'm working on a project using Zend framework and the message notification dialog
I am currently working on a project developed using Zend Framework, based on the
I'm currently working on a PHP project using CodeIgniter as my framework. I took
I am currently working on a project which is using Apache HttpClient 4.1.2 and
I am currently working on a multi branch desktop based project using VB.NET 2008.
Being a Windows developer I'm currently working on my own project using LAMP. I
I am currently working on a project that is using Dojo as the js

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.