Before I transfer a domain I would like to know I have the config files setup correctly. I don’t seem to be able to use server_name sub1.192.241.223.202 in
server {
listen 0.0.0.0:80;
server_name sub1.192.241.223.202;
access_log /var/log/nginx/ddAppSub1.log;
location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header HOST $http_host;
proxy_set_header X-NginX-Proxy true;
proxy_pass http://127.0.0.1:9000;
}
}
Will changing the ip above to MyDomain work when the domain is transfered?
server_name sub1.MyDomain.com;
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.
Yikes its working now!! … so there must have been a few minutes delay between adding the A record… Thanks for your help
I transfered my domain. that’s working. Added an A record so my domain has two A records @ and sub1 both pointing to the ip of my droplet 192.241.223.202 added a new file to /etc/nginx/sites-enabled with
sub1 is just pointing to the root menu for now…
reloaded nginx
navigating to http://sub1.cornerpins.com fails…
IP address cannot have subdomains. But, you can configure nginx to listen on
server_name sub1.mydomain.com
and add the following line to/etc/hosts
locally so thatsub1.mydomain.com
points to your droplet’s IP address: