Setting on Node.js on Laravel Forge

Posted 3 years ago by samiles


I have had a server running just fine with my Forge site over HTTP. Since upgrading to HTTPS the connection has broken. I need to set up running on my server with SSL. I have multiple sites installed on the server.

I was originally connecting to but simply switching to and installing SSL on the sub domain doesn't work. It gives a Nginx Bad Gateway error.

Does anyone know how to set this up? My front end code to connect is:

<script type="text/javascript" src=""></script>
var io = io('', { secure: true });

The code of my script is:

var https = require('https'),
    fs =    require('fs');

var options = {
    key:    fs.readFileSync('/etc/nginx/ssl/default/54082/server.key'),
    cert:   fs.readFileSync('/etc/nginx/ssl/default/54082/server.crt')
var app = https.createServer(options);

var io = require('').listen(app);


I know the Node.js code is running as it is receiving events and is showing the output it is receiving from Laravel in the terminal - just cannot connect on the front end.

Any ideas on how to achieve this set up and fix the SSL issue? What should the addresses be? I've found no tutorials on setting up with SSL. Thanks

Please sign in or create an account to participate in this conversation.

Reply to

Use Markdown with GitHub-flavored code blocks.