No, it isn't...I guess my experience with modifying these files is different than yours. Whenever the nginx settings are modified after editing that file directly, the file is reverted back to original and the new settings from the GUI applied to it. Is this not so?
My original script is doing something else. I have of course no experience with the posted script. It was written this morning and I did a few tests which passed...
The original script only creates a vhost_nginx.conf if none exists. To get Nginx to use that file I tried a few things and ended up with doing a plesk repair web.
This apparently creates an include in the domain's Nginx.conf and also makes it editable in Plesk's interface.
A Plesk repair web normally rebuilds everything based on the info it is in its database so surviving this makes me draw the conclusion it's stable.
I'm using that even as a cronjob.
It creates a HSTS include for sites that have a certain ssl plugin for WordPress (only if no vhost_nginx.conf exists and redirect to ssl is turned on).
Tomorrow I can post that script, but it may well be published already on this forum.
Try that "plesk repair web" before editing!
You never claimed you tested that.
Last edited: