Default page in NGINX

  • Posted April 11, 2014


I have install a new LEMP server by following the instructions here

The installation was successful by following the help guide.

Issue: When I go to my domain – it works great When I go to my domain - It automatically download a file. I would like it to default to index.php or index.htm or index.html.

How do I go about setting that up. Thank much for your help.


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.

works great :) <br> <br>changing default_type application/octet-stream; to default_type text/html; in nginx.conf solved the issue. <br> <br>Thanks much. <br>

It download a page because in nginx.conf you have: <br>default_type application/octet-stream; <br> <br>You can change it to <br>default_type text/html; <br>or something like that <br>More info: <br> <br>To have a default page <br>Use index index.php index.html; <br>More info: <br> <br>