Scale up as you grow — whether you're running one virtual machine or ten thousand.

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.

Hi guys, I’m kinda new to all the stuff related to deployment, servers, etc. I followed tutorials explaining how to setup a Linux 18 server with nginx, and the example worked properly.
However, when I redirect the proxy to my application and then try to access it via a browser, I have a 502 error.
Here’s the code of my node app :
const https = require("https");
const express = require("express");
const app = express();
const dotenv = require("dotenv");
const mongoose = require("mongoose");
const cors = require("cors");
const mustacheExpress = require("mustache-express");
dotenv.config();
// Connect to DB
mongoose.connect(process.env.DB_CONNECT, { useNewUrlParser: true }, () => {
console.log("connected to DB !");
});
app.use(function (req, res, next) {
res.header("Access-Control-Allow-Origin", "*");
res.header(
"Access-Control-Allow-Headers",
"Origin, X-Requested-With, Content-Type, Accept"
);
next();
});
// Middleware
app.use(express.json());
// Templating
app.engine("html", mustacheExpress());
//import routes
const authRoute = require("./routes/auth");
const devisRoute = require("./routes/devis");
const messageRoute = require("./routes/message");
const actuRoute = require("./routes/actu");
//Routes middlewares
app.use("/api/user", authRoute);
app.use("/api/sendDevis", devisRoute);
app.use("/api/message", messageRoute);
app.use("/api/actu", actuRoute);
// app.get("/", (req, res) => {
// return res.status(200).json({ status: "OK" });
// });
app.use(express.static("../front-end/dist/natan-website"));
app.get("/", function (req, res, next) {
res.redirect("/");
});
app.listen(3000, () => console.log("Server is running !"));
Does anyone have an idea of the mistake I’ve made ?
jhonnydepp12
dolphinnn
Vaishnavi Vundyala
016512ea60864da0867e5280f293de
Peter Monadjemi
Prince7hakur
devjk1
fc9acbfbc3124cbf8df28a1c5c5cdb
ab871885551143798f41908c709271
gouskova
Saivion Services