Introduction
Sometimes, you want to change the web address a user types into something else behind the scenes. The rewrite directive in nginx helps you do this by changing URLs before the server processes them.
When you want to redirect old website pages to new ones without breaking links.
When you need to remove or add parts of a URL for cleaner addresses.
When you want to force all traffic to use HTTPS instead of HTTP.
When you want to hide query parameters from users by rewriting URLs.
When you want to organize URLs to match your app’s internal structure.