Redirect rules in Nginx

Use the following to redirect to https on nginx.

server {
listen 80;
server_name my-domain.com;
return 301 https://$server_name$request_uri;
}

Simple and Performant Security.
Easily improve site security with WordPress Hardening, Two-Factor Authentication (2FA), Login Protection, Vulnerability Detection and SSL certificate generation.