Trying to set up a server block on nginx but I don't want to use a domain, I want to use a ipaddress

August 27, 2019 208 views
Nginx Ubuntu 18.04

I want a server blocks for my mobile app which means that i don’t need a domain. I would like to use my ipaddress instead. Does anyone know how to do this

2 Answers

Hello,

If you are going to host only one application then you could just use the default Nginx config file and add your rules there. The location should be at:
/etc/nginx/sites-enabled/.

That way when you access your droplet’s IP address you would be seeing the content specified by the rules of this default config.

Hope that this helps.
Regards,
Bobby

Thank you so much for this response. I however, intend to also host a site on it in the future. Hope I won’t have a problem then?

Have another answer? Share your knowledge.