0

I am setting up a private web server to host some files and a simple web page for my personal usage. I copied an index file into a new index.php and added some pho to it as instructed by nginx documentation, but then deleted the old index.

At first it worked, until I deleted the old one. I thought it was irrelevant but I got the gateway error when trying to login to my localhost.

Where is there a new skeleton index that I can possibly copy over, or did I just need to set proper permissions on my '/var/www/html' directory?

1 Answers1

0

First of all I want to be sure you have a firewall set up(if you are under a NAT that should do), because hosting a public web server at home can lead to some nasty security issues, so be sure no one from outside your LAN can have direct access to it.

I'm not sure which original index file you are referring to (because they might be more than one) but I guess this is the one you are looking for.

The problem I guess happened was that nginx expected a index.html and you provided a index.php. You may be able to change this in nginx's config file

If, however, this happened because of permission issues take a look at this answer here.

gmelodie
  • 195
  • I already have the config file changed, and as far as my router settings I haven't forwarded any ports yet, just using it at my house on my devices. I believe that there may be a problem with the file permissions when I copied it with 'cp' under the new name 'index.php' there was a permission warning that I, foolishly, ignored and just issued sudo. I deleted the original file assuming that it was working still. – Whiskey Face Aug 22 '19 at 15:03