Quantcast
Viewing all articles
Browse latest Browse all 972

http to https redirect

Hi All,

I want to run my website on https using nginx

I tried with following way
app.js
var express = require('express');
var app = express();

app.get('/', function (req, res) {
res.send('Hello World!');
});

var server = app.listen(3000, function () {
var host = server.address().address;
var port = server.address().port;

console.log('Example app listening at http://%s:%s', host, port);
});

var express = require('express');
var app = express();

app.get('/', function (req, res) {
res.send('Hello World!');
});

var server = app.listen(3000, function () {
var host = server.address().address;
var port = server.address().port;

console.log('Example app listening at http://%s:%s', host, port);
});

/etc/nginx/sites-enabled/localhost
server {
listen 80;

ssl_certificate /etc/apache2/ssl/apache.crt;
ssl_certificate_key /etc/apache2/ssl/apache.key;

server_name http://localhost:3000;
return 301 https://localhost:3000;
}

service nginx restart
and tried
https://locahost:80 but it is not working

Viewing all articles
Browse latest Browse all 972

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>