You could add the above into the server block for port 443. No other changes are needed.
MikeMcQ
11
Related topics
| Topic | Replies | Views | Activity | |
|---|---|---|---|---|
| Nginx + certbot - redirect https www to https | 14 | 11053 | January 15, 2021 | |
| Non-www https to www https | 2 | 2663 | September 20, 2016 | |
| Nginx https www redirect to non-www using let's encrypt certbot | 8 | 4618 | January 15, 2018 | |
| Redirect all http://www.example.com and https://www.example.com traffic to https://example.com. Using Certbot and Nginx | 2 | 1145 | February 2, 2020 | |
| Https not redirecting to www (nginx) | 3 | 502 | January 12, 2023 |