title: ExpressJS/Node: 404 images
body: <p>I've set up a basic node/express server which serves public static javascript and css files fine, but returns a 404 error when attempting to serve images.</p>
  
  <p>The strangest part is that everything works fine when run locally.  When run on my remote server (linode), the image problem arrises.</p>
  
  <p>It's really got me scratching my head... What might be the problem?</p>
  
  <p>Here's the server:</p>
  
  <pre><code>/**
   * Module dependencies.
   */
  
  var express = require('express')
    , routes = require('./routes')
  
  var app = module.exports = express.createServer();
  
  // Configuration
  
  app.configure(function(){
    app.set('views', __dirname + '/views');
    app.set('view engine', 'jade');
    app.use(express.bodyParser());
    app.use(express.methodOverride());
    app.use(express.compiler({ src: __dirname + '/public', enable: ['less'] }));
    app.use(express.static(__dirname + '/public'));
    app.use(app.router);
  });
  
  app.configure('development', function(){
    app.use(express.errorHandler({ dumpExceptions: true, showStack: true })); 
  });
  
  app.configure('production', function(){
    app.use(express.errorHandler()); 
  });
  
  // Globals
  
  app.set('view options', {
    sitename: 'Site Name', 
    myname: 'My Name'
  });
  
  // Routes
  
  app.get('/', routes.index);
  app.get('/*', routes.fourohfour);
  
  app.listen(3000);
  console.log("Express server listening on port %d in %s mode", app.address().port, app.settings.env);
  </code></pre>