Hello!
I’ve been trying to figure this out all week and keep ending up the same solution. Maybe there’s a better way?
Anyways, I’m attempting to use my digital ocean server to host a website that has HTML and CSS. I have Nginx on my server and it is running and I have a website hosted. It turns out Nginx does not support CSS in any way or form.
How do I get around this? Or, is there something else I should be using outside of Nginx?
Thank you in advance!
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!
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.
Enter your email to get $200 in credit for your first 60 days with DigitalOcean.
New accounts only. By submitting your email you agree to our Privacy Policy.
Hi there,
In addition to what has already been mentioned, you could also host your HTML + CSS static website for free on the DigitalOcean App Platform.
Here is a quick video on how to do that:
Hope that this helps.
Best,
Bobby
Thank you so much for the feedback!
How do I access the config file?
I’m also not opposed to Apache. It’s not necessarily Nginx where I believe the issue is. I’m really new and the amount of new “how to” Nginx content that is available is unreal. I can show you 100 videos on how to hook up a static html website and not one that shows how to host multiple websites on a single server.
Anyways, thank you again for your time.
Hi @b54a07ce39b84b9987aec80a170775,
As explained by Sergio already, Nginx is not the cause of the CSS not displaying itself. Having said that, what you can add in your configuration file for your website is
Of course change the path /usr/share/nginx/html/; to your actual website path.
Additionally, if you are finding Nginx difficult, you can always use Apache as an alternative:
https://www.digitalocean.com/community/tutorials/how-to-install-the-apache-web-server-on-ubuntu-20-04