INSTALLER UN NOUVEAU SITE AVEC APACHE ET NODEJS

27/07/2017

in your vhost add


    RewriteEngine On
    RewriteCond %{REQUEST_URI} ^/socket.io [NC]
    RewriteCond %{QUERY_STRING} transport=websocket [NC]
    RewriteRule /(.*) ws://localhost:10000/$1 [P,L]

    ProxyRequests Off
    ProxyPass / http://localhost:8000/
    ProxyPassReverse / http://localhost:8000/
    ProxyPreserveHost On

check theses modules

a2enmod proxy
a2enmod proxy_wstunnel
a2enmod proxy_http

exemple nodejs app :

var http = require('http');
http.createServer(function (req, res) {
res.writeHead(200, {'Content-Type': 'text/plain'});
res.end('Hello Apache!\n');
}).listen(8000, '127.0.0.1');

pour mettre letsencrypt : http://blog.raphaelpiccolo.com/?p=409
pour mettre un https de qualite max : http://blog.raphaelpiccolo.com/?p=19

Raccourcis