I am wants using Nginx as reverse proxy for my express.js app.
here is my nginx config :
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 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.