2

I have an apache2 server which runs all my php web application and I am trying to run a nodejs application. I have enabled proxy and proxy_http but it always shows 503 service unavailable page

<VirtualHost *:80>
        SERVERNAME abc.mysite.com
        SERVERALIAS www.abc.mysite.com

        DocumentRoot /var/www/html/node_app/
        options -Indexes

        ProxyRequests off
        #ProxyPass /maintenance.html !
        ProxyPass / http://localhost:3000/
        ProxyPassReverse / http://localhost:3000/
</VirtualHost>

node_app folder has app.js which launches express server

This is my app.js

var http = require('http'),
        express = require('express'),
        chatServer = require('./lib/chat-server');


var app = express();
app.use(express.static(__dirname + '/public'));

var server = http.createServer(app).listen('3000', '127.0.0.1');
app.get('/', function(req, res){
        res.sendFile(__dirname + '/views/index.html');
});

app.get('/client', function(req, res){
        res.sendFile(__dirname + '/views/client.html');
});

Please help, I have no idea what i am doing wrong.

Thank you

1
  • 1
    apache works bad with nodejs, use nginx
    – jmp
    Jun 9, 2020 at 22:12

0

You must log in to answer this question.

Browse other questions tagged .