Unable to add "location /" to additional nginx directives for domain in Plesk: nginx: [emerg] duplicate location "/"




  • Avatar
    Marco Marsala

    There is a bug: after deselecting checkbox Proxy mode, you must hit Save or Apply, and only after this step, you can add the directives, and save or apply again.

    If you deselect the checkbox and add the directives in the same step, without an intermediate save or apply operation, you'll still get the error.

  • Avatar
    Artyom Volov

    Hello @Marco Marsala,

    Thank you for the feedback!

    This behavior was reproduced in a test environment.

    Currently, a request to the Development Team was created to clarify the nature of it.

    We will update you as soon as we get any new information.

  • Avatar
    Artyom Volov

    Hi @Marco Marsala,

    This behavior was confirmed as a product bug with ID PPPM-9841, thank you for bringing our attention to it!

    You can subscribe to the article below to get a notification when the bug will be fixed.

    As for a workaround - just disable Proxy Mode, save changes then insert the necessary directives and save changes again.

  • Avatar
    Marco Marsala

    Not authorized to see the URL

  • Avatar
    Alisa Kasyanova

    @Marco Marsala
    Please try again, it should be visible now.

  • Avatar
    Peter (Edited )

    I can define a custom `location /` but it will never match because the default nginx.conf contains:


    location ~ /$ {
        index "index.html" "index.cgi" "index.pl" "index.php" "index.xhtml" "index.htm" "index.shtml";


    This will obviously match first, is there a way to disable this directive?

  • Avatar
    Konstantin Annikov


    The issue you are speaking about, is described in this article. And in resolution section you could find that this default configuration could be overwritten using custom configuration templates

Please sign in to leave a comment.

Have more questions? Submit a request