Skip to content

Instantly share code, notes, and snippets.

@aykuli
Last active February 5, 2024 05:24
Show Gist options
  • Select an option

  • Save aykuli/0cf01a31dfbfab741bedb23468500f3c to your computer and use it in GitHub Desktop.

Select an option

Save aykuli/0cf01a31dfbfab741bedb23468500f3c to your computer and use it in GitHub Desktop.
nginx

nginx

location regexp

location [modifier] [URI] {
  ...
  ...
}

The modifier in the location block is optional. Having a modifier in the location block will allow NGINX to treat a URL differently. Few most common modifiers are:

none: If no modifiers are present in a location block then the requested URI will be matched against the beginning of the requested URI.

=: The equal sign is used to match a location block exactly against a requested URI.

~: The tilde sign is used for case-sensitive regular expression match against a requested URI.

~*: The tilde followed by asterisk sign is used for case insensitive regular expression match against a requested URI.

^~: The carat followed by tilde sign is used to perform longest nonregular expression match against the requested URI. If the requested URI hits such a location block, no further matching will takes place.

Sources

  1. https://www.digitalocean.com/community/tutorials/nginx-location-directive
  2. https://min.io/docs/minio/linux/integrations/setup-nginx-proxy-with-minio.html
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment