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.

I have a client with an existing domain name which cannot be pointed to my server just yet.
So in the meanwhile I’ve added my node app and configuring the reverse proxy. This is what I’ve done:
Added domain entries to my local machine’s hosts file: 134.209.53.229 example.com 134.209.53.229 www.example.com
on my droplet’s hosts file, I did the same: 134.209.53.229 example.com 134.209.53.229 www.example.com
My nginx reverse proxy setup. This is my /etc/nginx/sites-available/default file:
server {
listen 80 default_server;
listen [::]:80 default_server;
root /var/www/html;
index index.php index.js index.html index.htm index.nginx-debian.html;
server_name example.com www.example.com;
location / {
proxy_pass http://localhost:8000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
}
Now what happens if I visit any subpath, like http://example.com/products, everything works fine.
But, when I visit root http://example.com - contents are loaded fine, but the address in my browser address bar changes to http://134.209.53.229 .
Looking at my network tab, I see that initiator is example.com, but in the request headers host is actually 134.209.53.229 (not example.com).
How can I fix this?
I followed this guide to set up the reverse proxy: https://www.digitalocean.com/community/tutorials/how-to-set-up-a-node-js-application-for-production-on-ubuntu-16-04
The only prerequisite I have not done is SSL - again because I cannot point this domain name to my server yet. I don’t think that should have anything to do with it though.
WildcatMedia
jeffs
0621335d663b4b699a60eb27e28153
accesstrax
Dwight Trumbower
admin
yimprogramming
samunyi90
1d6ce141ab5444dfb1ea2dd29cf4b1
Matt Fricker
joel9b158e40551b15093f213f