-
You don’t need to manually add this:
server { listen 80; location / { return 301 https://$host$request_uri; } }
-
The ssl certificate path is automatically generated and added by Virtualmin when you request a certificate for a virtual server.
-
Revert the changes you made to this line
listen 443 ssl http2 default_server;
back to the default generated by Virtualmin and just addhttp2
to it. -
Restart Nginx.
TLDR: To enable http2, you don’t have to change anything in the default Virtualmin-generated virtual host file except add http2
to this line:
listen xxx.xxx.xxx.xx ssl;
So it’ll look like this:
listen xxx.xxx.xxx.xx ssl http2;
And then simply restart Nginx.