I'm in need to make some changes in some files in the plugins folder. Is there a way to make changes that holdup when updating ISPConfig? Like with customized files in the conf-custom folder and config.inc.local.php for example?
No, that's core code of ISPConfig. You should consider writing your own plugins if you need customizations instead of changing the core plugins.
That's what I thought and expected the answer to be. Unfortunate for me but thanks @till Where's the Don't like button when you need it I was already searching for a workaround that doesn't include changing core code and do think that's possible in this case but will require a whole lot of research first from my side.
I managed to work it out partly and added the desired customization. But I can't figure out where this line is coming from: Code: rewrite ^(?!/(\.well-known/acme-challenge))/(.*)$ https://domain2.tld/$2 redirect; It is a Nginx based webserver where I redirect vhost domain1.tld to domain2.tld using the redirect tab. File /usr/local/ispconfig/server/conf/nginx_vhost.conf.master only has 2 times "$2" in it and those lines aren't the source (local_redirects and own_redirects)
That's the line to do that redirect. and $2 is the content of the second match of the rewrite regex, or in other words, $2 contains the URL part after the domain (its the match for (.*) in that line).
Yes I know what it does, but where does it come from? I want to alter it a bit. I've looked at /usr/local/ispconfig/server/conf/nginx_vhost.conf.master and /usr/local/ispconfig/server/plugins-available/nginx_plugin.inc.php but can't find it.
Is it not in the nginx vhost template file? if not, then it must be in the plugin, it might be that it is a string that is built consisting of several varaibles.
That's where I would expect it but can't find it. There are several comparable lines, but all accompanied by if statements, which the mentioned line hasn't.
It must be one of these two: Code: <tmpl_loop name="local_redirects"> if ($http_host <tmpl_var name='local_redirect_operator'> "<tmpl_var name='local_redirect_origin_domain'>") { rewrite ^<tmpl_var name='local_redirect_exclude'>(.*)$ <tmpl_var name='local_redirect_target'>$2 <tmpl_var name='local_redirect_type'>; } </tmpl_loop> <tmpl_loop name="own_redirects"> <tmpl_if name='use_rewrite'> <tmpl_if name='exclude_own_hostname'>if ($http_host != "<tmpl_var name='exclude_own_hostname'>") { </tmpl_if>rewrite ^<tmpl_var name='rewrite_exclude'>(.*)$ <tmpl_var name='rewrite_target'>$2 <tmpl_var name='rewrite_type'>;<tmpl_if name='exclude_own_hostname'> }</tmpl_if> </tmpl_if> probably the first one. To find the code in the plugin, search either for local_redirects or own_redirects.
The first one already is altered to fit my needs. The second was my initial suspect but as you can see it too has an if statement accompanying the rewrite rule. The line in question in the generated vhost file hasn't.
To clearify what I'm trying to accomplish is to add an exception for rewriting /.well-known/security.txt besides the default /.well-known/acme-challange (and other folders depending on the rewrite type).
Search the plugin code for .well-known/acme-challenge, it must be in there somewhere. What you get as vhost file must be either in the template or in the code or in the database.
Only related things to find there are "redirect_path" and "redirect_type", which ofcourse got saved from within the panel, but not the rewrite itself.
I should smack myself Completely misread the <tmpl_loop name="own_redirects"> part in /usr/local/ispconfig/server/conf/nginx_vhost.conf.master
Managed to get it working for the most part. Except for rewriting to intenal url's. I can't find the variable containing the subfolder the rewrite points to, which I need for the rewrite exceptions. Also found a bug in nginx_plugin.inc.php while testing different configs and reported it.
Sometimes all you need is half a good night sleep Just thought of another solution which will eliminate herefor struggle I mentioned and will keep /usr/local/ispconfig/server/conf/nginx_vhost.conf.master more original Going to give it a go later this afternoon.
Took a bit longer than I anticipated and a little help from a friend but I now have the regex running doing exactly what I want without compromizing the original functionality since yesterday. Not only /.well-known/acme-challange/ and other folders, depending on the rewrite type, are excluded from rewrites but /.well-known/security.txt as well. Tested all I could and everything seems to do what I want.