At the top of my lighttpd,conf file I have the following

server.modules = (
# "mod_rewrite",

At the bottom I addded

proxy.server = (".js" => (
    ( "host" => "", "port" => 3000 )

If I go to my JS file (containing console.log('test');) I get an Internal Server Error

I tried putting it in a $HTTP["host"] condition, and removing .js but neither work

Node is fine, if I run node test.js from command line, it works

  • So what's the error in the Lighttpd error log? – mgorven Mar 5 '13 at 22:32

So what service is running on port 3000? Try your request directly against that port (like curl http://localhost:3000/somename.js).

But I think you somehow got the misconception that nodejs is like php where you can run any .js file with nodejs as you run .php with php - that is not the case. nodejs is not a "CGI" interpreter by itself (although you could probably write one with nodejs that runs other js files).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.