• We value your experience with Plesk during 2024
    Plesk strives to perform even better in 2025. To help us improve further, please answer a few questions about your experience with Plesk Obsidian 2024.
    Please take this short survey:

    https://pt-research.typeform.com/to/AmZvSXkx
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

What does nginx for Plesk actually do?

Dree

Basic Pleskian
In theory nginx is a very nice addition to the webhosting server because it can handle the static requests and pass dynamic requests to Apache.
But I don't see anything like that configured in the nginx configuration. It looks like it just forwards every request to Apache.

Am I missing something here or is that the only thing it does?
 
From Plesk 11 Release Notes:

Administrators can improve the work of the web server which hosts customer websites by installing nginx, a supplementary high-performance web server specifically designed for delivering large amounts of static content.
The system will configure this server to work as a reverse proxy - nginx becomes a frontend web server that processes all incoming requests from site visitors. The requests are sent to Apache which, in turn, distinguishes requests for static and dynamic content. If a request is for a static file (like jpg, css, html, and so on), Apache passes the request through all registered handlers (applies .htaccess directory-level configuration, rewrites a URL, and so on) and returns to nginx a response which contains only a location of the requested file on the file system. nginx locates the file and sends it to the client. If the request is for a dynamic file (like a PHP script), Apache executes the file and sends the response to nginx, which delivers it to the client.
Such combination of two servers gives the following advantages:

The maximum number of concurrent connections to a website increases.
The consumption of server CPU and memory resources decreases.
Efficiency of serving visitors with slow connection speed (GPRS, EDGE, 3G, and so on) improves.
 
Well, many people think Nginx is great because it takes static requests off Apache. That's not the reason really. Our tests indicate that Apache would handle static file almost equally effective as Nginx. Actually there is not much room to optimize over 'fopen' system call.

The benefit of Nginx is that it doesn't consume much RAM while serving any kind of multiple requests. It is just how it is designed and you can read more on its architecture from Nginx authors if youou are interested in. On the other hand, Apache would consume a lot and what's worse - surely it won't free RAM until request is complete. That results in multiple simultaneous processing consuming RAM altogether while they are waiting for client side to complete receiving output.

And here is how Nginx helps - it grabs content from Apache very quickly (as it is local and doesn't depend on network bandwidth), thus Apache process ends sooner, thus less simultaneous processes, thus much lower RAM consumption in Apache. And as I said, Nginx wouldn't consume much RAM itself, thus your server operates more efficiently.
 
I read that on Twitter, very nice.
Also the per-domain config for Nginx is very nice, makes it easier to configure caching since mod_expires feels buggy.
Any idea when 11.5 is ready for release? A few weeks of months?
 
However I believe Plesk could a bit bolder on the plans they have for ngnix.

For instance you could create mini installations of Apache for Python/DJango or Tomcat and have them proxied by NGNIX.
These Python or Tomcat installations would not disturb each other, so they could allow a Plesk powered hosting company
to provide a full range of options for web development, not only php/MySQL.


Hi Dree,
sorry, we don't have ETA for 11.5 yet.
 
Administrators can improve the work of the web server which hosts customer websites by installing nginx, a supplementary high-performance web server specifically designed for delivering large amounts of static content.
The system will configure this server to work as a reverse proxy - nginx becomes a frontend web server that processes all incoming requests from site visitors. The requests are sent to Apache which, in turn, distinguishes requests for static and dynamic content. If a request is for a static file (like jpg, css, html, and so on), Apache passes the request through all registered handlers (applies .htaccess directory-level configuration, rewrites a URL, and so on) and returns to nginx a response which contains only a location of the requested file on the file system. nginx locates the file and sends it to the client. If the request is for a dynamic file (like a PHP script), Apache executes the file and sends the response to nginx, which delivers it to the client.


Can you point to a document which describes configuration files, their location etc. for such a setup on Plesk? Ideally version pre-11.5. Thank you
 
Hi,
I'm using Plesk 11.5 configured with all the three "nginx settings" checkboxes enabled. I was supposing, with third checkbox checked, to have nginx as unique web server without any interaction with Apache.
On the contrary, I discovered that Apache is still used sometimes... e.g. url rewrite is performed by it, according to .htaccess configuration.
Could you please clarify this point? What's exactly the behaviour of the web server with those three checkboxes set?

Regards,

M
 
3rd option seem quite self-descriptive in what it does. It only defines who serves PHP files, and it doesn't define what happens to all other files.

With all 3 options enabled you did
1) enable reverse proxy mode for all static files you have (involves Apache by definition - it is proxy). Compliant with URL rewrite
2) made Nginx serve predefined extensions of static files independently from Apache - maybe more effectives than 1), but conflicts with url rewrite rules. Remaining static files still served as reverse proxy
3) made Nginx serve PHP files independently from Apache - whatever other scripting files you would have, it still goes to Apache

Note that you didn't disable Apache, it stills processes files not covered by options 2 and 3, and it does involve .htaccess and url rewrite rules for sure. URL rewrite will not be involved when processing files from 2) and 3) - so while these options can give you significant performance boost, you need to act with discretion when enabling them.
 
Sergej, really really thanks for your prompt clarification.
So, as far as I understand there is not a pure nginx option currently in Plesk, is there?
Regarding URL rewrite and other directives (e. G. Mod expires), is it anyway possible to add specific additional nginx directives in order to manage properly the cases Apache is not involved?
Is this configuration generally recommended for best performances?
Thanks,
M
 
Hi, yes, we don't yet allow full disabling of Apache. Mainly because not all functions are yet available in nginx. Nginx has own built-in functions for URL Rewrite. Once you learn how to use them, you can just add them into custom Nginx directives for your vhost.

Nginx reverse proxy - option #1 is generally recommended and thus enabled by default. Options #2 and #3 may not fit some sites, mainly the ones relying on Apache URL Rewrite.
 
Do you mean Plesk 12? 11.5 version has been released long time ago.

In plesk 12 there are some issues with nginx (and/or bind) when running the linux system in Azure. Any ideas about the origin of the problem?

Some contradictory output from command line checking:

cmd: /usr/local/psa/admin/sbin/nginxmng -s
result: enabled

cmd: /etc/init.d/nginx status
result: nginx is not running

cmd: /etc/init.d/nginx start
result: Not starting NGINX as it is disabled in config

Somewhat peculiar, any ideas (for example errors in config)?
 
Last edited:
In plesk 12 there are some issues with nginx (and/or bind) when running the linux system in Azure. Any ideas about the origin of the problem?

Some contradictory output from command line checking:

cmd: /usr/local/psa/admin/sbin/nginxmng -s
result: enabled

cmd: /etc/init.d/nginx status
result: nginx is not running

cmd: /etc/init.d/nginx start
result: Not starting NGINX as it is disabled in config

Somewhat peculiar, any ideas (for example errors in config)?

What sort of output:

# rpm -qa | grep nginx
# rpm -Va sw-nginx

?
 
Could you show output of command?
service nginx configtest

The configtest command does result in "OK". However, this is something for Parallels to consider:

a) the command service nginx configtest only tests (apparently) the /etc/nginx/nginx.conf file (and format thereof),

b) the /etc/nginx/plesk.conf.d/server.conf and /etc/nginx/plesk.conf.d/webmail.conf remain "broken", that seems to be the case and this is somewhat contradictory, given that

- (on the one hand) the extension "Webserver Configurations Troubleshooter" indicates errors, and
- (on the other hand) nothing seems to be wrong with the format of these conf files.

Finally, a remark has to be made: in the meantime some issues with bind are found to be related to (strange) apparmor (behavior) and not nginx.

In the plesk installer script, Parellels should allow for checking apparmor profiles (that impede bind9 service from starting) AND automatically applying the solution to problems caused by apparmor and bind9: add the line "/var/named/run-root/** rwm," to /etc/apparmor.d/local/usr.sbin.named file.

However, that does not resolve three major nginx issues:

1) messy server.conf and webmail.conf files when changing IP (double entry of IPs),

2) restarting nginx and/or regenerating scripts does not handle IP changes well,

3) in some cases, nginx conf scripts are not updated at all,

and that is probably a hint towards a solution for the nginx issues encoutered.

Following that hint, I (just) found out that the rereading the IP (Tools&Settings, IP addresses) is a "ad-hoc solution":

a) rereading correct (removing incorrect) IP addresses has to been done manually,

b) one correct IP address AND regenerating config files with the "Webserver Configurations Troubleshooter" extension does result in proper config files, although nginx error messages remain for all incorrect IP adresses that have not been removed,

and hence, try rereading correct AND removing incorrect IP addresses, FOLLOWED by regenerating nginx conf files.

In conclusion, both the (original) bind9 service issues and the nginx error issues can be resolved fairly easily.

However, Parallels should prevent this kind of manual adjustments, so I am asking Igor or Sergey U. the following:

- why not checking for apparmor at installation of the Bind9 module of Plesk Panel and applying the line "/var/named/run-root/** rwm," in /etc/apparmor.d/local/usr.sbin.named file?
- why not checking for correct IP addresses AND regenerating nginx files at the start of psa service? (the removal of incorrect IP addresses can be done manually)?

That should make life a lot more easy for most of Plesk users (and it is a simple modification).

Kind regards.....
 
However, Parallels should prevent this kind of manual adjustments, so I am asking Igor or Sergey U. the following:

- why not checking for apparmor at installation of the Bind9 module of Plesk Panel and applying the line "/var/named/run-root/** rwm," in /etc/apparmor.d/local/usr.sbin.named file?
- why not checking for correct IP addresses AND regenerating nginx files at the start of psa service? (the removal of incorrect IP addresses can be done manually)?

That should make life a lot more easy for most of Plesk users (and it is a simple modification).
AppArmor is a security tool that uses name-based mandatory access controls to restrict or confine the system access of “at risk” applications. AppArmor is not supported by Parallels Plesk Panel. Sometimes AppArmor can interfere with Plesk installation or functionality.

http://kb.parallels.com/en/112903
 
IgorG,

Apparmor is not an issue, potential problems with Apparmor can always be resolved by setting apparmor profiles correctly.

In this case, a change in apparmor profile(s) resolved the issue that bind9 was not starting.

The real issue here is nginx and, in the meantime, it has to be added that some testing resulted in the preliminary conclusion(s) that

a) installation and/or reinstallation of nginx (via CLI, with the plesk-installer command) does yield random results (and never success),

b) the /etc/nginx/plesk.conf.d directory is not and/or often not installed.

Note that the above is not necessarily related to the erratic behavior of nginx, it is just another task on the TODO list for the plesk 12 (OS: Ubuntu 12.04 LTS) release version.

Please provide a reaction to the above.
 
Back
Top