nodejs domain without port number

后端 未结 3 1586
被撕碎了的回忆
被撕碎了的回忆 2020-12-13 05:50

I have deployed my nodejs app on a VPS(ubuntu 10.04). I have hosted it on a subdomain (subdomain.myapp.com:3000) and I just have one IP address

By default port 80 is

3条回答
  •  执念已碎
    2020-12-13 06:01

    Just an update of @drinchev answer with Apache 2.4.*

    Enable the proxy mode :

    a2ensite proxy_http
    a2ensite proxy
    

    Then :

    
        ServerName subdomain.myapp.com
    
        ProxyRequests off
    
        
                Require all granted
        
    
        ProxyPass / http://localhost:3000/
        ProxyPassReverse / http://localhost:3000/
        ProxyPreserveHost on
    
    

提交回复
热议问题