Host Asp.Net Core Web API and MySql with Nginx on a DigitalOcean 5$ Ubuntu 18.04 Droplet

<html>
<head>
<title>Welcome to Appone.com!</title>
</head>
<body>
<h1>Success! The appone.com server block is working!</h1>
</body>
</html>
<html>
<head>
<title>Welcome to Apptwo.com!</title>
</head>
<body>
<h1>Success! The apptwo.com server block is working!</h1>
</body>
</html>
server {
listen 80;
listen [::]:80;
root /var/www/html/appone.com;
index index.html index.htm;
server_name appone.com www.appone.com;
location / {
try_files $uri $uri/ =404;
}
}
server {
listen 80;
listen [::]:80;
root /var/www/html/apptwo.com;
index index.html index.htm;
server_name apptwo.com www.apptwo.com;
location / {
try_files $uri $uri/ =404;
}
}
server {
listen 80;
server_name apptwo.com *.apptwo.com;

location / {
proxy_pass http://localhost:5000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection keep-alive;
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}
fail: Microsoft.AspNetCore.Server.Kestrel[13]
Connection id “0HLOESG0CKQ07”, Request id “0HLOESG0CKQ07:00000001”: An unhandled exception was thrown by the application.
MySql.Data.MySqlClient.MySqlException (0x80004005): Host ‘137.68.99.187’ is not allowed to connect to this MySQL server

--

--

--

What I’m doing now https://manju.la/now

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Jumping Into Jekyll

How To Create Interactive Reports In R Markdown Part III: Reactive Elements

What I Learned From Kaggle Courses (Working with External Libraries)

The One Thing bundleIQ Does Better Than Any Other Company

why Laravel’s eloquent sucks

API Gateway — Secure & Lightweight API Communication for Mobile Client

Canary Deployment using Istio with Helm

How to integrate R with Power BI

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Manjula Liyanage

Manjula Liyanage

What I’m doing now https://manju.la/now

More from Medium

ASP.NET Core Web APIs with AWS Lambda

MySQL in Docker

REST API & Koa JS

Introduction to MongoDB