By 2xLoop
I can publicly access the page i’d like to serve through my droplet IP at port 5000, but can’t reach it with my domain?
A “dig +trace www.mydomain.com” command gets responses from the DigitalOcean nameservers but nothing past that.
I have 3 NS records directing from my domain (@) to ns1.digitalocean.com, ns2.digitalocean.com, ns3.digitalocean.com. I have 2 A records saying hostnames * and @ will direct to my droplet IP. I have 1 CNAME record saying ‘www’ hostname is an alias of ‘@’. These were created weeks ago, it seems like they would be propagated by now.
I’m wondering if there’s something missing in my nginx configuration.
If my nginx config block looks like:
http{
...
server {
listen 80;
server name mydomain.com www.mydomain.com;
location / {
proxy_pass http://0.0.0.0:5000;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $server_name;
}
}
}
is there anything else that is necessary to serve the page at my domain?
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Hello,
As long as you have both of your www and your non-www versions pointing to your Droplet’s IP address it should work as expected.
Your Nginx looks correct, there’s only one thing that I’ve noticed which might be causing the issue, you need to change:
server name mydomain.com www.mydomain.com;
To:
server_name mydomain.com www.mydomain.com;
Note the missing underscore. Then run a config test with nginx -t and if you get Syntax OK message, restart Nginx.
Regards, Bobby
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.