OPNsense Forum

Archive => 21.1 Legacy Series => Topic started by: stanthewizzard on February 22, 2021, 03:37:58 PM

Title: Nginx plugin as a webserver to serve directory
Post by: stanthewizzard on February 22, 2021, 03:37:58 PM
Hello All

I would like to use the nginx plugin as a simple webserver to list a directory and make file donwloadable.

I don't understand how.


Thank you very much
Title: Re: Nginx plugin as a webserver to serve directory
Post by: Fright on February 22, 2021, 04:03:02 PM
hi
don't think it's possible via GUI only.
you can create a location without specifying upstream via GUI, but the rest of the configuration will have to be done by hands via the hook in location block
Title: Re: Nginx plugin as a webserver to serve directory
Post by: stanthewizzard on February 22, 2021, 06:36:44 PM
oooh god

Any idea how ?
thank you
Title: Re: Nginx plugin as a webserver to serve directory
Post by: Fright on February 22, 2021, 07:34:23 PM
need to add hook to location template (like https://forum.opnsense.org/index.php?topic=21154.msg99523#msg99523)
then create dir(s) for your location(s) post conf file(s) and put your conf(s) with needed directives there.
(https://docs.nginx.com/nginx/admin-guide/web-server/serving-static-content/)

and also
https://docs.opnsense.org/manual/how-tos/nginx_hosting.html

but, if i may, imho the fact that it is technically possible does not make it a better idea