By paulstocks
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;
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!
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
server {
listen 0.0.0.0:80;
server_name sub1.cornerpins.com;
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;
root /opt/cornerpinsRoot;
index index.html index.htm;
}
}
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 that sub1.mydomain.com points to your droplet’s IP address:
1.2.3.4 sub1.mydomain.com
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.