如何解决使用Cloudflare + Portzilla子域在主域上不起作用吗?
我的代码:
const express = require('express')
const https = require("https")
const crypto = require("crypto")
const fs = require("fs")
const app = express()
const config = {
cert: String(fs.readFileSync("../cert.crt")),ca: String(fs.readFileSync("../ca.ca-bundle")),key: String(fs.readFileSync("../private.key"))
}
const server = https.createServer(config,app)
app.get('/',(req,res) => {
res.send('Hello,World!')
})
app.get('/:test',res) => {
res.send(req.params.test)
})
server.listen(2053,'myip',() => { console.log("hosting") });
它检查所有子域,如我的代码所述,并输出req.params.test
。因此,当我进入mydomain.com/home/testing123
时,我的网站吐出了testing123
。
它仅检查本地路由app.get('/',res) => { res.send('Hello,World!') })
。因此,当我转到mydomain.com/home
时,我的网站给了我一个404 not found错误。但是,如果我转到mydomain.com
,我的网站就会吐出Hello,World!
如何检查原始域中的所有子域?还是有比Portzilla更好的Cloudflare?
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。