I need to push my node app updates to remote host which is really wired. It uses standard cPanel + apache bundle, but also has node installed. Root domain mywired.host hosts static files from public_html. Subdomain api.mywired.host is looking to a dir with following .htaccess file:

<IfModule mod_rewrite.c>
  RewriteEngine On
  RewriteCond %{HTTPS} off
  RewriteCond %{REQUEST_URI} !^/[0-9]+\..+\.cpaneldcv$
  RewriteCond %{REQUEST_URI} !^/\.well-known/pki-validation/[A-F0-9]    {32}\.txt(?:\ Comodo\ DCV)?$
  RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

And the fun part is that there's two node applications running now, first uses port 3001, second 3002. And if I send queries to api.mywired.host/fisrt I got a response from 3001 port app, and when I send it to the the api.mywired.host/second I get response from 3002 port app. I literally cannot figure out how this magic works, and I feel afraid to kill old application and run the fresh ones.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.