我在3000端口上使用nodejs,我的站点是ssl认证的.运行节点server.js后,我得到以下错误:
去叫https://--.---.-.---:3000/socket.io/?EIO=3&transport=polling&t=1513323461271-0 net::ERR_CONNECTION_REFUSED。
那么,如何使用具有不同端口的单个ssl证书运行节点js和apache呢?我的网站托管在亚马逊服务器上。
发布于 2020-03-02 07:29:29
希望您已经在Apache中配置了SSL。
节点(快递)
const express = require('express');
const app = express();
var cors = require('cors')
app.use(cors());
var server = require('http').createServer(app);在服务器中打开httpd.conf,并根据需要添加ProxyPass行
ProxyPass /api/ http://localhost:3000/不要放弃重新启动HTTP服务
http://www.example.com/mypage apache http:好的!
https://www.example.com/mypage apache :好的!
http://www.example.com/api/节点http:好的!
https://www.example.com/api/节点https: WORKKS!
https://stackoverflow.com/questions/47827815
复制相似问题