When developing FOTA functions, file servers are occasionally used. This blog briefly introduces how to use nginx to quickly build a local file server under Linux to facilitate testing during development.
Quick Start
Install nginx
1 | $ sudo apt-get install nginx |
start service nginx
1 | $ sudo service nginx restart |
More info: Download
Create config file
1 | $ sudo gedit /etc/nginx/conf.d/file_server.conf |
Modify the config file
1 | server { |
More info: nginx config
Make the configuration effective
1 | $ sudo rm /etc/nginx/sites-enabled/default |
Add index.html or source
1 | $ pwd |
Finally, link to the local IP address through the browser to view the file or web page.
