Code-server.my_domain not directing to the code-server page

Posted January 3, 2020 1k views


I’m trying to setup code-server on CentOS 7, but I am unable to get to code-server.my_domain.

I am able to go to http://my_domain (which directs me to the CentOS welcome page), but going to code-server.mydomain or http://code-server.mydomain gives me the following message in Firefox:

“Hmm. We’re having trouble finding that site.

We can’t connect to the server at code-server.my_domain”

I’ve been following the instructions here, and I’ve gotten through step 2:

I’ve copied and pasted the code into the /etc/nginx/conf.d/code-server.conf file, and it looks like this:

server {
listen 80;
listen [::]:80;

server_name code-server.my_domain;

location / {
    proxy_pass http://localhost:8080/;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection upgrade;
    proxy_set_header Accept-Encoding gzip;


Not sure what to do from here.

Looking forward to hearing back!

  • Have you confirmed your DNS record is pointing to the servers IP?


    SnapShooter DigitalOcean Backups

  • I think so.

    I have two A records:
    mydomain -> myserverip
    domain -> myserverip

    And 3 NS records:
    mydomain ->
    domain ->
    my_domain ->

    I believe that’s all that the tutorial says is required. I did briefly try adding code-server.mydomain -> myserver_ip, but that didn’t seem to work either, so I removed it.

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
1 answer

Hi @esquire,

What you would need to do is add an A record for your subdomain name to point to your Droplet’s IP address.

Also note that once you make the DNS change, it could take up to 24-48 hours for the DNS to propagate before you could see the change.