Ich habe eine Node.js App auf einem Apache-Server (der andere non-node.js-Sites hostet). Hier ist der Apache-Setup um den Verkehr zu senden alle auf www.mysite.com zu Knoten auf Port 12001:Ich bevorzuge 'www' Subdomain mit Node.js auf Apache-Server
<VirtualHost *:80>
ServerAdmin [email protected]
ServerName www.mysite.com
ServerAlias mysite.com www.mysite.com
ProxyRequests off
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
<Location />
ProxyPass http://localhost:12001/
ProxyPassReverse http://localhost:12001/
</Location>
ErrorLog /var/log/apache2/mysite-error_log
TransferLog /var/log/apache2/mysite-access_log
</VirtualHost>
Und Ich möchte alle Menschen zwingen, mysite.com Besuch zu www.mysite.com umgeleitet werden.
Im Knoten kann ich nicht req.headers.host
überprüfen, da es immer localhost:12001
entspricht und ich bin mir nicht sicher, wo ich .htaccess
Datei setzen sollte.