Installing NGINX
- Install NGINX
$ pkg install nginx
- Create folder
$ mkdir /data/www
- Find configuration file nginx.conf
It’s either in /usr/local/nginx/conf, /etc/nginx or /usr/local/etc/nginx - Edit conf file, comment out everything then add a new server block
http { server { } }
- Add a location into the server block
location / { root /data/www; } location /images/ { root /data; }
- Create a basic html file in /data/www
<html> <head></head> <body><h1>hello NGINX</h1></body> </html>
- Start nginx
$ nginx
- To stop NGINX use
$ nginx -s stop
Leave a Reply