Our features site is undergoing a refresh! Be sure to explore the revamped site and discover our latest product roadmap launching here on Monday, March 18th.

Nginx proxied to Apache (not standalone Nginx)

esalogica shared this idea 10 years ago
Completed

Install Nginx listening on port 80 as a proxy to Apache and permit to select on a per-domain basis to use Nginx to serve static content.

Best Answer
photo

Hello,

We've provided this functionality in v112 of cPanel & WHM, which shipped in Q2 of 2023: https://docs.cpanel.net/knowledge-base/web-services/nginx-with-reverse-proxy/

Replies (18)

photo
1

It is extremely unlikely that Nginx would be considered in a configuration where it is setup with a proxy to Apache. This increases complexity by a significant amount and presents unique problems that would not exist in a standalone configuration.


What is most likely, if Nginx is pursued as a feature for cPanel & WHM, would be for it to be included as a standalone daemon. This is like mentioned in this feature request:


http://features.cpanel.net/responses/as-a-server-administrator-i-want-standalone-nginx-supported-as-an-alternative-to-apache-so-that-i-can-offer-faster-speed-and-lower-load-on-smallers-servers


I would advise posting further comments and voting in that feature.

photo
3

I like the idea (ran out of votes).

I came from Plesk where I used the built-in nginx proxy with zero problems and great results and tried some proxy-plugins for WHM and had nothing but trouble.

Even .htaccess files worked great the way that Plesk did it.

And the by-domain setting would help with any odd problem coming up.

I would advise to catch up with Plesk in this regard.

photo
1

Varnish might be a better solution - there is a feature request for that.

photo
2

Brilliant that this is now been changed to planned, especially after the only comment originally from cPanel saying that it would be unlikely ! Any idea of timescale for this to be implemented ?

photo
2

Hi!


We haven't quite started on this yet, but it's currently planned to work on our first iteration of Nginx and caching during our 11.54 release cycle. Once we start working on it / get closer to that point, I'll be sure to keep this request updated :)

photo
1

Any update yet?

photo
2

There is no update yet. We're still working on abstracting the web server away from cPanel. We'll update this feature post when we get started.

photo
photo
1

We weren't able to get nginx added in v54 like we were hoping, and don't yet have an updated estimate for the delivery here. We're currently working to get EasyApache 4 stable and fully integrated, and then we'll work on adding features. Some of those features will include adding support for additional Webservers.

photo
1

That sounds like you are planning to add nginx as an Apache replacement.

This feature request is about using nginx as a reverse proxy [ mod note: removed external link ] - just with tight integration for domain selection and maybe even SSL support.

photo
1

Sorry about the confusion. We'll definitely be considering both approaches!

photo
1

@benny Just following up to see of there has been any movement on this now that EasyApache 4 has been released and were in version 58? Nginx as a proxy to apache would be brilliant to help speed things up

photo
1

Not yet specifically planned, but we're definitely getting more of the roadblocks out of the way, allowing us to actually get started on this. I'll let you know as soon as there's an update!

photo
photo
1

Meanwhile one can use Engintron! Now supports EA4.

photo
1

Just remember Engintron is awesome yes BUT it does not currently support SSL, so if you are using SSL Certs or even the free SSL provided by the new AutoSSL feature, engintron is pointless for you, unless you serve content via HTTP and not HTTPS

photo
1

Check https://www.tabaklaedeli.ch is under engintron, and runs just fine. As I said all SSL must be installed over Apache, and will work just fine. Since it's just proxying them.

photo
1

If you check the header information of your website - (Network tab of firefox console - probably same in chrome) you will see you site is actually served by apache, engintron (nginx) does nothing for you on an SSL site it will only serve regular unsecure traffic. There are various threads about this on engintrons github including one from me asking about SSL support

photo
photo
1

Sadly Engitron doesn't support TLS/SSL yet. It is planned though

photo
1

You dont need it, since it allows the Usage of current Apache SSL/TLS in place. So I use Engintron with many SSL sites and they work flawlessly.

photo
1

If not apachebooster will do the do ;)

photo
photo
2

Hi cPanel,


I was just wondering about this feature, when it is released into stable lines, will the nginx proxy support SSL and PHP-FPM or will SSL be handled solely by apache (like other plugins such as engintron mentioned in other comments)


The real bonus here will be to have nginx handle both

photo
1

Any update on this? It seems there were talks about adding this in v54 but we're now heading towards v64.

photo
1

No update, but as soon as there is one I'll be here!

photo
1

Is it planned for 64 or a later version?

photo
2

It's not yet assigned to a version, but as soon as we're aiming at a version I will update everyone here.

photo
photo
2

Have been using Engintron for 5 months now with SSL and it is brilliant. There is enough manual config too so you can tune your micro caching. I know the developer personally and he manages some high performing / high traffic sites and he is committed to performance and development. +1000

photo
1

I use own Python script https://github.com/partizanes/ApacheToNginxHttpsCpanel/blob/master/s6/compareHttpsHosts.py for avtomatic generation nginx config file with all ssl certificate, direct static , http2 support.


The script check if apache config changed and generate new nginx.conf. This file need to include to main nginx config.

"include /etc/nginx/conf.d/*.conf;"

photo
1

Any news about this ?

photo
1

No updates yet, unfortunately. We're still working on improving EA4, but when we add nginx support hasn't been decided yet.

photo
photo
2

With the

importance of SSL and the auto-ssl feature from cPanel, this feature would need

to be able to support both HTTP and HTTPS services.


Otherwise

simply listening on port 80 would neglect most of the client on today’s current

server and lose on the performance gain that NGINX could bring.


I would

prefer a solution with Nginx as a reverse proxy on port 443, Varnish on port 80

and apache in the back end!!! (Wishful thinking! :D)

photo
2

@Daniel Berthiaume


I totally agree with that.


There is not a suitable Nginx plugin which supports 443 on the cPanel EasyApache 4. We have tested all of them.


[Here was the list of third party plugins, but the moderator asked me to remove their names] There are bugs with EA4 every now and then with those plugins.


It would be a great move if you guys achieve Nginx with port 443 and 80 to serve as a reverse proxy or even as a standalone engine web server with port 443 and 80 to serve as the proxy or even as a standalone web server.

photo
1

Would it be possible for this to be released with HTTP2 support? Or does that fall into the other request for HTTP2 with apache and EA4?

photo
1

HTTP2 is completely independent of Nginx, and nginx support is much too large to be considered for inclusion in the HTTP2 development.

photo
photo
8

Hey all! I wanted to provide a quick update for you. We're at a point with EasyApache 4 adoption that we're comfortable adding nginx support, but we need to find time for a feature team to work on the building the RPM, building the integration, and write all of the massive amounts of testing that will go along with adding the support. We just completed planning for version 68, and none of the feature teams were able to pick this up. We go to version 70 planning in around 3 months. If a feature team picks it up by then, I'll be back to let everyone know! Otherwise, expect to see this in 2018. As always, if you have questions in the meantime, feel free to email me: benny@cpanel.net

photo
1

Hello,

We've provided this functionality in v112 of cPanel & WHM, which shipped in Q2 of 2023: https://docs.cpanel.net/knowledge-base/web-services/nginx-with-reverse-proxy/

Leave a Comment
 
Attach a file