Reputation: 63
I've a DirectAdmin shared hosting account that has NodeJS support with CloudLinux.
I've deployed a simple ExpressJS app to test it but only index page works and when trying to view other routes or even requesting an asset file like .css/.js file getting error Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request
.
Found the error in user stats -> error_log with message [core:error] [pid x:tid x] [client w.x.y.z:0] AH00124: Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.
per request.
This is my server.js:
const express = require('express');
const path = require('path');
const app = express();
const libpath = '../nodevenv/nodeapp/22/lib';
// set the view engine to ejs
app.set('view engine', 'ejs');
// use assets for static files
app.use(express.static(__dirname + '/public'));
// index page
app.get('/', function(req, res) {
res.render('pages/index');
});
// test another route
app.get('/path', function (req, res) {
res.send(__dirname);
});
app.listen();
Upvotes: 0
Views: 37