nodeJS https redirect

Discussion in 'Installation/Configuration' started by Kemp, May 21, 2023.

  1. Kemp

    Kemp Member

    Hi,

    Can you please tell me how to redirect http to https for nodeJS.

    What should I add to Apache Directives?

    Currently I have:
    Code:
    ProxyPreserveHost On
    ProxyPass /node http:://127.0.0.1:3000/
    Thank you!
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    I guess, using the standard HTTP to HTTPS redirect from the redirect tab should be sufficient.
     
  3. Kemp

    Kemp Member

    That doesn't work for some reason, thank you!
     
  4. pyte

    pyte Well-Known Member HowtoForge Supporter

    Could you at least tell us what is happening? Is the node app working without the HTTP -> HTTPS redirect?
     
  5. Kemp

    Kemp Member

    Hi,

    Yes it's working, http and https works but when you type http it doesn't automatically redirect to https --that's what I would like to do

    Thank you!
     
  6. pyte

    pyte Well-Known Member HowtoForge Supporter

    Hm, as till already said it should work if enabled. Could you check the vhost file for further debugging. Once without the redirect set in the site options and once with it enabled?

    If you're not familiar with it you can post it here. The vhost files are stored in /etc/apache2/sites-enabled/
     
  7. Kemp

    Kemp Member

    It's working now, thank you!
     

Share This Page