redirect angular website to https from http

hello team,

i am trying to add a redirect for site and i set a complete redirect for non ssl to ssl. here is the code which i added,

server { listen 80; listen [::]:80; server_name _; return 301 https://websitename.com$request_uri; }

this is not redirecting the user to ssl. can any one help me out with the issue that i need to change or make any change with the config.

my main issue is i have 5 sub domains and all the subdomains need to be redirected to https instead of http.

Thanks in advance.

submitted by /u/shiva-shankar
[link] [comments]
Source: Reddit