Reputation: 18
I completed and hosting my NodeJs based website on Google Cloud App Engine, and connected my domain Lumix that I got from name.com, and also I am using a Cloudflare free CDN option. After finalizing, I encountered the following problems:
If I visit the website by typing the following in the browser:
lumix.live
: The website Loads up but says that the connection is not secure.
www.lumix.live
: The website doesn't load up at all with the error DNS_PROBE_FINISHED_NXDOMAIN
.
https://lumix.live
: Website loads up correctly along with being displayed as secure.
// 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");
});
I have the following settings:
My DNS records on Cloudflare: https://i.sstatic.net/wxu2F.png.
My Settings On Cloudflare: https://i.sstatic.net/GUflc.png.
My Custom Domains on Google Cloud Project: https://i.sstatic.net/N0mpZ.png
So far, I have tried adding a Certificate from Cloudflare on Name.com as well as Google Cloud, but it shows it as invalid. I tried generating and adding a CSR and key from Google Cloud to name, but that shows as invalid as well. I suspect that on name.com has something called Symantec Encryption Everywhere installed, and it might be the reason, but when I open, it asks for a certificate.
Also, when I am trying to deploy an updated version of the app now on Google, it repeatedly errors out with ERROR: (gcloud.app.deploy) Error Response: [4] Timed out waiting for the app infrastructure to become healthy.
. On Searching, It seems that their servers might just be too busy. Maybe that is causing this problem.
Please help me fix this.
Upvotes: 0
Views: 173
Reputation: 18
So what worked for me was to configure the app.yaml, to redirect the requests to https, it had some problems with flex type but worked fine with F2.
My app.yaml looks like this
runtime: nodejs12
instance_class: F2
handlers:
- url: /.*
secure: always
redirect_http_response_code: 301
script: auto
Upvotes: 0