2022 Developer Survey is open! Take survey.

New answers tagged

1 vote

Regex to remove certain patterns from urls

If all your URIs should match the pattern you given (two letter prefix before the locale part): rewrite "^(/\w{2})/en-(?:us|gb)(/.*)" $1$2 permanent; (regex pattern should be quoted due to ...
user avatar
  • 2,005
1 vote

What is the difference between Nginx variables $host, $http_host, and $server_name?

TL;DR: If you don't use regular expressions in server_name you can ignore this answer 😉. Since this aspect hasn't been mentioned at all in other answers, but it's something that I found somewhat ...
user avatar
  • 1,436

Top 50 recent answers are included