• 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.

Resolved Nginx only mode impossible ???

Igo

New Pleskian
Plesk Onix Nginx Only mode
Please someone explain me how this possible ???
this is settings for domain ( no special proxy settings in virtual host configuration)

nginx.jpg php.jpg

in apache logs have found next log
apache.jpg

what i must switch off to do not proxy requests to apache ???
 
I myself always use nginx as standalone webserver. What I always do is just turn off proxy mode and use FPM application served by nginx. I also turn off "serve static files directly by nginx" and "smart static file processing" - although its may not relevant anymore after we turn of Proxy mode.

And I'm sure its won't use Apache because even I removed htaccess file my websites still running fine. All of them are Drupal sites, which depend heavily on htaccess settings (clean URLs, security etc).

FYI, I also have nginx custom template in /usr/local/psa/admin/conf/templates/custom/domain/nginxDomainVirtualHost.php so I dont have to edit every sites conf everytime I add site. But ofcourse it is not related to your first question.

I hope Plesk will have a PURE nginx only version, so we dont have to turn off proxy mode, smart static etc everytime I add site. I ever read that Igor said that Plesk will have PURE nginx version but until now its not happened.

I dont know why Apache still preferred, nginx has proven capability in YEARS. Maybe for business purpose so Litespeed could shine ??
 
Last edited:
I dont know why Apache still preferred, nginx has proven capability in YEARS. Maybe for business purpose so Litespeed could shine ??

Maybe because a lot of hoter have extremely large Apache sites and are unwilling to change a running system? Maybe because most older web-applications run best on Apache in full functionality? Esspecially those relying on .htaccess like even Wordpress?

And Litespeed is just a lot of glamour around a "worse than nginx" product, which includes some mod_pagespeed funtionality. Looks better and faster, but nothing you cant do better with nginx. The only real need for Litespeed is for those to have a faster drop-in-replacement for Apache, while paying license-fees. Dont believe the tests you did not fake for yourself. :)

And while at it: Apache + nginx = fastest Wordpress stack ever on Plesk.
 
I ever read that Igor said that Plesk will have PURE nginx version but until now its not happened.
Yes, we are working on this and it's only a matter of time. The main problem is that there are too many dependencies on the Apache from the past.
 
Yes, we are working on this and it's only a matter of time. The main problem is that there are too many dependencies on the Apache from the past.

Please leave the option of Apache + nginx in place. Its actually the sole reason I came back for Plesk :)
 
Hello,

you can also disable the option "Serve static files directly by Nginx"
really???
this helps? by adding proxy template to nginx conf

block 1 = serve static files OFF (PROXIED MODE)
Code:
<?php if ($VAR->domain->active && $VAR->domain->physicalHosting->proxySettings['nginxServeStatic']): ?>
    location @fallback {
        <?php if ($VAR->domain->physicalHosting->proxySettings['nginxProxyMode']): ?>
            <?php echo $VAR->includeTemplate('domain/service/proxy.php', $OPT) ?>
        <?php else: ?>
        return 404;
        <?php endif ?>
    }

block 2 = serve static files ON (NGINX only Mode)
Code:
    location ~ ^/(.*\.(<?php echo $VAR->domain->physicalHosting->proxySettings['nginxStaticExtensions'] ?>))$ {
        try_files $uri @fallback;
        <?php if ($VAR->domain->physicalHosting->expires && $VAR->domain->physicalHosting->expiresStaticOnly): ?>
        expires <?=$VAR->quote($VAR->domain->physicalHosting->expires)?>;
        <?php endif ?>
    }
<?php endif ?>

already have checked and manually edited nginx conf
removed all blocks like
proxy_
location @fallback

apache log exists
 
Last edited:
really???
this helps? by adding proxy template to nginx conf

block 1 = serve static files OFF (PROXIED MODE)
Code:
<?php if ($VAR->domain->active && $VAR->domain->physicalHosting->proxySettings['nginxServeStatic']): ?>
    location @fallback {
        <?php if ($VAR->domain->physicalHosting->proxySettings['nginxProxyMode']): ?>
            <?php echo $VAR->includeTemplate('domain/service/proxy.php', $OPT) ?>
        <?php else: ?>
        return 404;
        <?php endif ?>
    }

block 2 = serve static files ON (NGINX only Mode)
Code:
    location ~ ^/(.*\.(<?php echo $VAR->domain->physicalHosting->proxySettings['nginxStaticExtensions'] ?>))$ {
        try_files $uri @fallback;
        <?php if ($VAR->domain->physicalHosting->expires && $VAR->domain->physicalHosting->expiresStaticOnly): ?>
        expires <?=$VAR->quote($VAR->domain->physicalHosting->expires)?>;
        <?php endif ?>
    }
<?php endif ?>

In fact, it 's the same with or without "Serve static files directly by Nginx", all requests are handled by Nginx.
For me, without Apache, it doesn't make sense to enable this option.

But I have tried on my server, and there isn't any Apache access logs when the proxy mode is disabled.
 
Yes, we are working on this and it's only a matter of time. The main problem is that there are too many dependencies on the Apache from the past.
Thats a very good news to me. Thank you.

May I request to not include "location /" directive in nginx main template ? how about integrate nginx pagespeed ? Plus it would be much appreciated if Plesk allow custom template options that can be chose on Plesk interface. For example: we could create our custom template for Drupal 6, Drupal 7/8, WP, Magento etc. and they will be inserted as a dropdown in Plesk. I see free panel VestaCP implemented this and its really nice.
 
Last edited:
  • Like
Reactions: Igo
how about integrate nginx pagespeed ?

Did you work with nginx pagespeed? My results: I did not like pagespeed on edge servers at all. Its a mess. Partially nginx became unpredictable when it comes to: which versions are proxied? (gzipped by pagepeed, gzipped by nginx, not gzipped), similar for pagespeed modded files up- and downstream to other ressources. Which cache is used? pagespeed versus nginx and when? Sure, I believe one can handle it, yet all I tell: it becomes a mess.

My results: Having backend and edge servers seperately is a blessing - you can even unify the caches via memcached or redis. Even better: with Apache you can keep CMSs Apache affinity with mod_pagespeed and have nginx edge servers, while keeping Apache backend ressource usage low with 1r/s or 1r/5s for each domain. Even though its Apache, we are still only talking about a few kb RAM per domain to handle those 1 requests per second. A few bucks for some more memory, but in return much easier administration and clear cuts between backend and frontend versus content optimization (pagespeed) and traffic optimization (caching).
 
May I request to not include "location /" directive in nginx main template ?

Tbh: thats imho not enough. A lot of things you might want to change, like:
  • ssl cipher orders
  • ssl bucket sizes
  • add/remove $cache_cookie "if"-statements
  • add/remove header handling in any server and any sub locations
  • more complex sub-domain handling/redirects
  • ...
Id suggest a complete httpd/nginx conf-editor for all relevant snippets.

Right now you need to change some in /etc/nginx/... and /etc/httpd/... as well as in the custom folders. Adding additional snippets is possible, but #no_fun, e.g. in the case of additional directives upon compilation of additional modules,...
 
I follow this Contribution - How to compile NGINX with additional modules ( pagespeed / cache_purge / headers-more / and others ) and Im very happy with the performance of all of my Drupal sites. I also added advance css/js aggregation module.

And exactly the issues I listed above come up, when you do it this way. In fact you can configure the current Onyx Beta to be faster than the result from that guide.

So: nice you are happy with it. I am not since I expect more.
 
one question,
does someone have tried to add some rules to apache common settings in nginx only mode ?
for example rule like "Deny IP" affects on the site but we cant see any changes in nginx configuration even with updated / replaced NGINX web server ....

thaks for all
issue resolved
by editing most of rewrites and redirects in configuration templates
/usr/local/psa/admin/conf

and have replaced mod security by
GitHub - SpiderLabs/ModSecurity-nginx: ModSecurity v3 Nginx Connector
and certbot
User Guide — Certbot 0.19.0.dev0 documentation
 
Last edited:
Back
Top