Enable NGINX-only hosting for your domain - Plesk

Enable NGINX-only Hosting for Your Domain

NGINX is an HTTP and reverse proxy server that many small and medium-sized websites love using. Mostly because of its sleek design and high performance fine-tuning for difficult conditions. It’s no surprise that lots of users are switching from Apache to NGINX – the former pre-installed on most Linux servers. Apache has been around for over two decades and has established itself as a popular web server worldwide. So why should you switch and set up NGINX-only hosting?

NGINX may be a better option for your high-traffic sites, making it a more robust and reliable service. Unsurprisingly, Apache performs relatively poorly under similar high pressure situations. Thus, resulting in a more sluggish performance under heavier loads. Therefore, more users want to know how to set up NGINX-only hosting in order to avoid such performance constraints. Thankfully, we have a very useful technical guide of how to achieve this switch.

Get Started and Set up NGINX-only Hosting

NGINX Hosting

Plesk for Linux users can choose from a variety of ways to host websites. Such as using a combination of NGINX and PHP-FPM. However, NGINX-Only hosting is a great alternative for websites that run on PHP. As well as for the hosting of static websites and application servers.

You can configure individual websites so that they’re only served by NGINX, without stopping or disabling Apache. By doing this, you make sure there’s no impact on the websites that are already hosted by Apache. If users employ other Plesk services such as Webmail, these will not be affected by the NGINX hosting switch. The former will just continue working using Apache.

NGINX-only Hosting: Limitations & Configurations

NGINX Hosting Limitations

There are a number of limitations you should consider when setting up NGINX-only hosting. Firstly, File Sharing becomes unavailable when you make this change. Secondly, SSI, Perl, and Python support services also stop being available. Lastly, know you can only use the “FPM application server by NGINX” PHP handler once they select NGINX-only hosting. Think about these limitations before proceeding with changing your server configurations.

In terms of configuration, with Linux servers, the default setting is that NGINX and Apache work simultaneously. Apache servers the dynamic content, while NGINX is popular for a proxy serving static content. We set this up to optimize the usage of server resources so that we can serve requests to hosted websites more efficiently. However, Plesk also allows users to choose the way in which static content is handled for their websites.

Serving content and files

nginx hosting - serving content and files

There are different ways of serving content and files when using NGINX hosting. Users can serve all static content via NGINX – the default way which Plesk for Linux works. Each time a request for static content comes in, Apache only indicates the corresponding file’s location. Then, NGINX finds it and serves it.

Users can also serve files with specific extensions via NGINX. Meanwhile, Apache is the one which servers other files generally classified as static content. It’s important to note that when using this specific scenario, requests for files with specified extensions never reach Apache. Therefore, they don’t pass through Apache handlers. So, be aware that rewrite rules or htaccess directives do not apply.

Another option is serving all static and dynamic content via Apache by disabling NGINX. This method can be useful in specific cases, such as when there is NGINX troubleshooting. However, we do not recommend this if you’re managing production websites.

You can easily use NGINX as a reverse proxy, and Apache still does a great job of handling dynamic content. As you can see from the various configurations in this article, you can use both servers at the same time. In fact, it’s more common to have Apache in the back-end, with NGINX as the proxy server on the front-end, managing requests.

Check our docs for more info on Apache and NGINX settings on Plesk Obsidian.

How to switch on NGINX hosting for your domain

  1. In Plesk, go to Domains > example.com > Apache & nginx Settings.
  2. In the nginx settings section, disable the Proxy mode setting.
How to switch on NGINX-only hosting for your domain

3. Apply the changes.

Enable NGINX-only hosting for all new domains under a service plan

  1. In Plesk, go to Service Plans > Example Plan > Web Server tab.
  2. In the nginx settings section, disable the Proxy mode setting.
  3. Click Update & Sync.

How useful was this post?

Click on a heart to rate it!

Average rating 4 / 5. Vote count: 3

Oh no, sorry about that!

Let us know how we can do better below

About

Elvis Plesky
Our fun and curious team mascot's always plugged into the latest trends. He's here to share his knowledge and help you solve your tech problems.
    Comments

    Leave a Comment

    Start typing and press Enter to search