【发布时间】:2018-07-03 21:16:49
【问题描述】:
实际状态:
http://www.example.com/mypage apache http:好的!
https://www.example.com/mypage apache https:好的!
http://www.example.com:8000 node http:好的!
https://www.example.com:8000 node https:不工作(仍然)
我尝试将节点程序修改为
var express = require('express');
var app = express();
var https = require('https');
var fs = require('fs');
var server = http.createServer(app);
https.createServer({
key: fs.readFileSync("/etc/letsencrypt/live/www.example.com/privkey.pem"),
cert: fs.readFileSync("/etc/letsencrypt/live/www.example.com/fullchain.pem"),
ca: fs.readFileSync("/etc/letsencrypt/live/www.example.com/chain.pem")
}, app).listen(443);
这里明显的问题是apache已经在监听443端口了,那么
Error: listen EADDRINUSE :::443
有没有办法使用 Apache 443 为节点提供 SSL?
【问题讨论】:
标签: node.js apache ssl https reverse-proxy