@theywill
Your question has become twofold, hence obfuscating the actual root cause of the problem.
One part of your question is related to manual changes, automatic config overrides by Plesk, the symlink method as present in /etc/nginx/plesk.conf.d/ and Plesk Panel itself.
I can assure you that this part is not relevant at all - Plesk Panel works fine, the symlink method is standard and automatic config overrides are normal.
Another part of your question, being the topic that you started with, can be translated to "why the hell does it not work as I expect it to work?".
Well, I had to look many times myself and it occurred to me that your changes in Nginx config are not appropriate at all - they will never work.
First, the part
location /var/www/vhosts/domain.com/httpdocs/123/ {
autoindex on;
}
will never work : you are referring to a location that cannot be found by Nginx - it is not part of the root directory.
Second, the parts
location ~* {
autoindex on;
}
location / {
autoindex on;
}
are too generic - Nginx will never match these patterns : Nginx chooses the best matching pattern, being the default paths as provided by the default Plesk config for Nginx.
In short, a minor tweak of your config should do the trick.
One could try to use an explicit reference to a directory.
For instance, if the full file path is
/var/www/vhosts/domain.com/httpdocs/123/
and the root directory is
/var/www/vhosts/domain.com/httpdocs
and that should be the case by default,
then a solution could be using the explicit statement
location /[dir] {
autoindex on;
}
with [dir] replaced by the top-level directory for which you would like to have the autoindex directive create a "file browsing mode" for Nginx.
Please note that the part "
location /[dir]" is sufficient - every file or directory in the top-level directory [dir] would be accessible.
Also note that allowing directory browsing access is not very helpful in terms of security - there is some penalty in the form of a less secure domain.
Finally note that directory browsing access is also dependent on the file and ownership structure of all files and directories in the top-level directory [dir].
Anyway, I hope the above helps a bit.
Kind regards.......
PS I am pretty sure that the above solves your issues, but I am not perfectly certain - due to a specific default Nginx config in Plesk, customization of Nginx directives via the Plesk Panel will not always end in the expected result. It is a well-known problem, encountered by many. However, this well-known problem can be solved by creating your own custom Nginx templates - but if not necessary, one should not want customization of Nginx templates.