SSL证书和域访问异常

问题描述 投票:0回答:1

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

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

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

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

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

// 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记录:https://i.stack.imgur.com/wxu2F.png。我在Cloudflare上的设置:https://i.stack.imgur.com/GUflc.png。我在Google Cloud Project上的自定义域:https://i.stack.imgur.com/N0mpZ.png

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

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

请帮助我解决此问题。

node.js google-app-engine ssl https hosting
1个回答
0
投票

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

我的app.yaml看起来像这样

runtime: nodejs12
instance_class: F2
handlers:
- url: /.*
  secure: always
  redirect_http_response_code: 301
  script: auto
© www.soinside.com 2019 - 2024. All rights reserved.