Redirect all http traffic to https¶
Add following to the
server block of the
In case you want only a few endpoints to redirect to https, rather than all the traffic, you need to create two server blocks. One for http and other for https.
location block under each determines which endpoint redirects to https.
See this SO answer