Nginx - new server block template

Ubuntu 20.04 LEMP + Virtualmin 6.14 / Webmin 1.970
(installed with sh /root/virtualmin-install.sh -b LEMP -m)

How can I create a new server block in nginx conf file (etc/nginx/sites-available/example.com.conf)?
I’m trying to create a redirect from http to https, and www to no-www. I always did it manually, but is there a way to create a template?

I edited the file usr/share/webmin/virtualmin-nginx/virtual_feature.pl
and added some code. But it is inside the main server block. I want to create a new server block. Does anyone know how?

Here is my code:
https://pastebin.com/tSBDVCEu

Thanks!

Hello,
I just need the direction. If anyone could answer ‘look at the file xyz’ I’ll be glad.
Anyone? @ JamieCameron?

Thank you.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.