Run server nodejs with Apache

Sau khi run server nodejs với pm2.Một số lệnh pm2 cơ bản xem ở đây nhé
Cấu hình apache như sau:

<VirtualHost *:80>
    ServerAdmin youremail@something.com
    ServerName demo.gacoder.info
    ErrorLog /home/errors
    CustomLog /home/logs common
    ProxyRequests off
    <Proxy *>
            Order deny,allow
            Allow from all
    </Proxy>
    <Location /demo1>
            ProxyPass http://localhost:3000
            ProxyPassReverse http://localhost:3000
    </Location>

    <Location /demo2>
            ProxyPass http://localhost:3001
            ProxyPassReverse http://localhost:3001
    </Location>

</VirtualHost>

Truy cập link:
demo.gacoder.info/demo1
demo.gacoder.info/demo2

0 Shares

Leave a Reply

avatar
  Subscribe  
Notify of