• We value your experience with Plesk during 2025
    Plesk strives to perform even better in 2026. To help us improve further, please answer a few questions about your experience with Plesk Obsidian 2025.
    Please take this short survey:

    https://survey.webpros.com/

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