Express.js Failed to lookup view “default” in views directory

30 views
Skip to first unread message

Ali Reza

unread,
Apr 22, 2015, 9:46:58 AM4/22/15
to nod...@googlegroups.com

I am wants using Nginx as reverse proxy for my express.js app.

here is my nginx config :

server {
    listen 80;

    server_name  my server ip address;

    location / {
        proxy_pass http://myip:3000;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection 'upgrade';
        proxy_set_header Host $host;
        proxy_cache_bypass $http_upgrade;
    }
}


and its my app.js :

var express = require('express');
var mongoose = require('mongoose');
var app = express();

app.set('view engine' , 'ejs');
app.use(express.static('public'));

app.get('/song', function(req, res, next) {

   // my route
}


without nginx my app works very well but when i using nginx as reverse proxy and go to my songroute node give me this error : Failed to lookup view "default" in views directory

i want know where i am wrong. thanks.

Reply all
Reply to author
Forward
0 new messages