• Our team is looking to connect with folks who use email services provided by Plesk, or a premium service. If you'd like to be part of the discovery process and share your experiences, we invite you to complete this short screening survey. If your responses match the persona we are looking for, you'll receive a link to schedule a call at your convenience. We look forward to hearing from you!
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

Question NGINX Directives Location question

Noise

New Pleskian
Hi all

what is the different between these locations such:

Code:
location ~ /.
location ~* \.
location ~ /\.
location = /


which one is the right one to use in Additional nginx directives per domain ?
i'm a little confused about this an i'm very new to nginx

thx
 
Well there are a lot of documentation and explanation around for nginx directives like:
https://www.scalescale.com/tips/nginx/nginx-location-directive
Nginx Location Directive Explained - KeyCDN Support
Module ngx_http_core_module

so start read them...
  • =: The equal sign can be used if the location needs to match the exact request URI. When this modifier is matched, the search stops right here.
  • ~: Tilde means that this location will be interpreted as a case-sensitive RE match.
  • ~*: Tilde followed by an asterisk modifier means that the location will be processed as a case-insensitive RE match.
  • ^~: Assuming this block is the best non-RE match, a carat followed by a tilde modifier means that RE matching will not take place.
 
ok thx i read so much and my head is smoking now :D

i post a thread about my directives in the wrong section i do a new thread next time because i change many things.

one question i have here again

what is the different between this:

Code:
location ~* .(png|gif|ico|jpg|jpeg)$ {
  # Matches requests ending in png, gif, ico, jpg or jpeg.
  # Any request to the /img/ directory are handled by the location block above.
}

and this:
Code:
location ~* .(?:png|gif|ico|jpg|jpeg)$ {
}

i search a directive who takes me javascript with .js? like this:
Code:
/media/widgetkit/widgets/spotlight/js/spotlight.js?wkv=1.4.9

to add Expires headers
 
Please describe a bit more in detail, what do you like to achive and quote your complete directives and how did you test/see that it is not working, perhabs then community can help
 
Back
Top