3

I am trying to redirect a subdomain on my website. For now, I have added the following block to the file at /etc/nginx/nginx.conf

    server {
        listen 80;
        server_name notebook.mysite.com;

        location / {
            proxy_pass http://0.0.0.0;
        }
    }

This should make visiting notebook.mysite.com the same as visiting mysite.com and show the homepage. Eventually, I will add a port so the location block contains proxy_pass http://0.0.0.0:12345; However, when I visit http://notebook.mysite.com my browser gives me the error

This site can’t be reached

notebook.mysite.com’s server DNS address could not be found.
DNS_PROBE_FINISHED_NXDOMAIN

Anybody know why this is, or at the very least how I would go about troubleshooting it?

1
  • 0.0.0.0 is not a valid IP to connect to. You want to change it to something like http://localhost or http://example.com. Commented Apr 24, 2016 at 5:11

1 Answer 1

13

Turns out I needed to add an A record with my host, Digital Ocean, for this to work properly. I added an A record with a * to redirect all subdomains to my server.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.