I installed the LEMP package from the marketplace, and I’d like to host a website that relies on having HTML files parsed as PHP. I can find instrucions for doing this with Apache, but not nginx. Is there an easy way to do this, or should I just start over with a LAMP installation?
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.
Click below to sign up and get $100 of credit to try our products over 60 days!
Hi there,
Yes, this is also doable with Nginx as well as Apache.
You need to duplicate the
.php
location rule and add one for.htm$
.So the configuration will look like this, depending on yuor PHP configuration:
Hope that this helps. Regards, Bobby
Please check out How To Install Linux, Nginx, MySQL, PHP (LEMP stack) on Ubuntu 18.04.