A
(for an A record that maps the subdomain to an IP address) or CNAME
(if you want to point it to another domain).dig
Open a Terminal or Command Prompt.
Use the dig
Command:
dig subdomain.domain.com
dig subdomain.domain.com CNAME
Note: DNS changes can take time to propagate. Typically, this is up to 48 hours, but it often happens much faster.
/etc/nginx/sites-available/subdomain.domain.com
nginx
server {
listen 80;
server_name subdomain.domain.com;
location / {
proxy_pass http://server_ip:9000;
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-Proto $scheme;
}
}
Create a symlink: sudo ln -s /etc/nginx/sites-available/myproject /etc/nginx/sites-enabled/
Teste Nginx configuration: sudo nginx -t
Reloade Nginx: sudo systemctl reload nginx