SSL证书和域访问异常

编程入门 行业动态 更新时间:2024-10-07 22:21:42

SSL证书和域访问<a href=https://www.elefans.com/category/jswz/34/1771210.html style=异常"/>

SSL证书和域访问异常

我在Google Cloud App Engine上完成并托管了基于NodeJs的网站,并连接了从name获得的域Lumix,并且我正在使用Cloudflare免费CDN选项。完成后,我遇到了以下问题:

如果我通过在浏览器中键入以下内容来访问网站:

  1. lumix.live:网站已加载,但显示连接不安全。

  2. www.lumix.live:该网站完全没有加载,错误为DNS_PROBE_FINISHED_NXDOMAIN

  3. :网站正确加载并显示为安全。

// Code Snippets of important parts of my node app. 
const express = require("express");
const bodyParser = require("body-parser");
const mongoose = require("mongoose");
const request = require('request');
const getJSON = require('get-json');
const mongoose_fuzzy_searching = require('mongoose-fuzzy-searching');
require('dotenv').config()
const app = express();

app.set("view engine", "ejs");
app.use(bodyParser.urlencoded({extended: true}));
app.use(express.static('public'));

....
app.get("/", function(req, res){
    res.render('home');
});

app.get("/result", function(req, res){
    res.render("result");
});

app.get("*",function(req,res){
    res.status(302).redirect("/");
})

app.listen(process.env.PORT || '8080', function(){
    console.log("server has started");
});

我有以下设置:

我在Cloudflare上的DNS记录:.png。我在Cloudflare上的设置:.png。我在Google Cloud Project上的自定义域:.png

到目前为止,我已经尝试在Name和Google Cloud上添加Cloudflare的证书,但该证书显示为无效。我尝试从Google Cloud生成CSR和密钥并将其添加到名称,但这也显示为无效。我怀疑在name上安装了名为Symantec Encryption Everywhere的东西,这可能是原因,但是当我打开时,它会要求提供证书。

[此外,当我尝试立即在Google上部署该应用程序的更新版本时,它反复出现ERROR: (gcloud.app.deploy) Error Response: [4] Timed out waiting for the app infrastructure to become healthy.错误。在搜索中,似乎他们的服务器可能太忙了。可能是导致此问题的原因。

请帮助我解决此问题。

回答如下:

所以对我有用的是配置app.yaml,将请求重定向到https,它在flex type上有一些问题,但在F2上工作正常。

我的app.yaml看起来像这样

runtime: nodejs12
instance_class: F2
handlers:
- url: /.*
  secure: always
  redirect_http_response_code: 301
  script: auto

更多推荐

SSL证书和域访问异常

本文发布于:2024-05-07 21:01:34,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1757238.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:异常   证书   SSL

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!