• Please be aware: Kaspersky Anti-Virus has been deprecated
    With the upgrade to Plesk Obsidian 18.0.64, "Kaspersky Anti-Virus for Servers" will be automatically removed from the servers it is installed on. We recommend that you migrate to Sophos Anti-Virus for Servers.
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

Question Detecting webspace in nginx directive

Miguel Nunes

New Pleskian
Is it possible to detect the current directive when using custom nginx directives in Plesk?

This is what I'm trying to do:
Code:
error_page 400 401 403 404 405 406 407 412 414 415 500 501 502 /custom_error_$status.html;
location ~ ^/custom_error_[0-9]+.html$ {
    root /var/www/vhosts/WEBSPACE_NAME/error_docs;
}

Right now I have to change WEBSPACE_NAME to the name of each Webspace. I'd like to know if there is or can be a variable that holds the webspace name or path of the open website.
 
Back
Top