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

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


Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

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.

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?


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