Closed SubliminalClip closed 2 years ago
The setup-ngxblocker as it stands now will never work for a plesk environment. You will simply need to place the relevant files in conf.d and bots.d and add the includes manually into your server {} block - see the manual configuration readme. I don't have Plesk so can't add any logic into the setup or install for it.
The setup-ngxblocker as it stands now will never work for a plesk environment. You will simply need to place the relevant files in conf.d and bots.d and add the includes manually into your server {} block - see the manual configuration readme. I don't have Plesk so can't add any logic into the setup or install for it.
That's a quick reply. Much appreciated. Okay, we'll do that and post back the results in due course. Other Plesk users may then have a point of reference, if they want to do the same (some definitely will!).
Did you look through existing ISSUES ? Yes
Describe the problem you are experiencing When using Plesk as a Hosting Control Programme on a server, one part of the supplied default script(s) will error at Step 4 in the default Installation Instructions, due (I think) to the default Plesk setups for vhost (domains) and nginx not being the same as standard OS installations.
Most notably, is the storage of domain specific nginx modifications here: /var/www/vhosts/system/hosted-domain-name/conf/ in both nginx.conf (see note ++) and _vhost_nginx.conf (see note +++) files, plus, just as importantly, the total absence of the required: /etc/nginx/sites-available/_ directory.
++ This file is auto-generated and contains modification warning as follows: ATTENTION! DO NOT MODIFY THIS FILE BECAUSE IT WAS GENERATED AUTOMATICALLY, SO ALL YOUR CHANGES WILL BE LOST THE NEXT TIME THE FILE IS GENERATED.
+++ This file is nearly always usually created via Plesk Panel GUI not via CLI
In theory, this, should be relatively straightforward to resolve, by way of a modified script to suit this type of Plesk installation. See suggestion in Additional Information at the end of this issue for more details. At the time of writing this post, the current, most advanced Plesk HCP is Plesk Obsidian. More than happy to liaise and beta test (alongside others if needed) any modified scripts that may be produced. as this Bot Blocker would be a very welcome addition to Plesk HCP users.
Only those that are to be expected:
Copy of nginx.conf Not required. This is not the issue, which is Plesk related not OS related.
Copy of vhost / website / host .conf file Not required. This is not the issue, which is Plesk related not OS related.
Screenshots None required. The issue is Plesk related.
Server (please complete the following information): None of this is required. This is not the issue, which is Plesk related not OS related.
Any other applicable log / error messages that may help us to help you. Not required. This is not the issue, which is Plesk related not OS related.
Additional information
By default, the Plesk provided /etc/nginx/nginx.conf does include: *include /etc/nginx/conf.d/.conf;** within http { }
Plesk users are able (and we have already) added self-generated *.conf files within: /etc/nginx/conf.d/ all of which operate successfully (within nginx) on all hosted domains. The following statement makes perfect sense (for normal OS):
This setup-ngxblocker script assumes that all your vhost files located in /etc/nginx/sites-available end in an extension .vhost. It is good practice to make all your vhost config files end with a .vhost extension but if you prefer to stick what you already have eg .conf you can simply modify run setup-ngxblocker using the -e parameter to specify the extension you use for your vhost files.
The issue within Plesk however, is both the name & location of default vhost files, those posted above and also this one: /var/www/vhosts/system/hosted-domain-name/conf/vhost.conf
Is it possible (?) to invoke this functionality with within Plesk via just one, newly created /etc/nginx/conf.d/nubbb.conf :o)) file (as well as all of the other *.conf files that are provided within the standard scripts) instead of, the default actions?