I have worked with Apache before, so I am aware that the default public web root is typically /var/www/
.
I recently started working with nginx, but I ca
In my case it was in /usr/share/nginx/html
you can try to find by performing a search
find / -name html
Just to note that the default index page for the nginx server will also display the root location as well. From the nginx (1.4.3) on Amazon Linux AMI, you get the following:
This is the default index.html page that is distributed with nginx on the Amazon Linux AMI. It is located in /usr/share/nginx/html.
You should now put your content in a location of your choice and edit the root configuration directive in the nginx configuration file /etc/nginx/nginx.conf
You can simply map nginx's root folder to the location of your website:
nano /etc/nginx/sites-enabled/default
inside the default file, look for the root in the server tag and change your website's default folder, e.g. my websites are at /var/www
server {
listen 80 default_server;
listen [::]:80 default_server ipv6only=on;
root /var/www; <-- Here!
...
When I was evaluating nginx, apache2 and lighttpd, I mapped all of them to my website sitting at /var/www. I found this the best way to evaluate efficiently.
Then you can start/stop the server of your choice and see which performs best.
e.g.
service apache2 stop
service nginx start
Btw, nginx actually is very fast!
Run the command nginx -V
and look for the --prefix
. Use that entry to locate your default paths.
The default Nginx directory on Debian is /var/www/nginx-default
.
You can check the file: /etc/nginx/sites-enabled/default
and find
server {
listen 80 default;
server_name localhost;
access_log /var/log/nginx/localhost.access.log;
location / {
root /var/www/nginx-default;
index index.html index.htm;
}
The root is the default location.
in ubuntu 19.04, we found it on
/usr/share/nginx/html