@Tomek
You stated
Dear Plesk Team, it would be great to see a guide for this on blog
and I must emphasize that it is not that easy to compile Nginx
AND make it Plesk compatible at the same time.
The compilation of a custom Nginx is not that difficult, but it will often result in a binary called Nginx........
......... and that makes it a little bit dangerous, when considering upgrade compatibility of Plesk.
In fact, when not changing the binary name at compilation time, the Nginx binary will be replaced by Plesk's default Nginx binary, if Plesk updates are affecting Nginx.
One can specify the binary name at compilation time, so that would be a work-around to prevent most upgrade compatibility issues.
However, even in that case, one still is not completely without problems: there still are some challenges.
In fact, when specifying a custom name at compilation time, one still has the problem that Plesk use a default configuration referring to a binary called "nginx".
In addition, one has the problem that one cannot easily run two Nginx instances on the same system: they will "compete for http requests", potentially resulting in conflicts.
A dirty work-around would be the usage of a symlink with name "nginx" that points to the custom binary.
This symlink based work-around will work until a Plesk upgrade of the Nginx package will occur: the re-creation of the symlink after upgrade is easy.
This dirty work-around is safe: both Plesk's default Nginx binary and the custom Nginx binary can co-exist and are to a large degree upgrade safe.
But it is not an optimal solution.
An alternative is to
a) use a small VPS with a custom compiled Nginx to function as a proxy of all Plesk hosted domains, (or)
b) wait for the moment that Plesk's default Nginx binary finally supports dynamic modules AND all normal Nginx modules are available as dynamic modules, (or)
c) port normal "static" Nginx modules to a dynamic module,
and those alternatives are not really satisfactory.
Personally, I prefer the VPS based alternative, but I do recommend the symlink based (dirty) work-around to start with.
Anyway, I hope the above helps a bit.
And note that this topic is worthy to be posted in a separate topic thread, since the support of custom compiled Nginx instances is a potential future for Plesk.
Regards...........