Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a Node.js app which is heavily reliant on websockets. I want to redirect anyone trying to access it via http (80) to https (443). I would use nginx however it does not play well with websockets. No other service needs to run on the server.

What is the best way to do this redirect?

share|improve this question
up vote 1 down vote accepted

Many ways to do this but a simple one would be for Nginx to listen only on port 80 (HTTP) and redirect all traffic to 443 (where nodejs is listneing) before any web socket connections are initiated.

share|improve this answer
how can I do it? – Jaro Feb 13 '14 at 23:55

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.