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.

One comment

  1. thanks for this useful information

Add a Comment

Your email address will not be published. Required fields are marked *

GET LATEST NEWS AND TIPS

  • Yes, please, I agree to receiving my personal Plesk Newsletter! WebPros International GmbH and other WebPros group companies may store and process the data I provide for the purpose of delivering the newsletter according to the WebPros Privacy Policy. In order to tailor its offerings to me, Plesk may further use additional information like usage and behavior data (Profiling). I can unsubscribe from the newsletter at any time by sending an email to [email protected] or use the unsubscribe link in any of the newsletters.

  • Hidden
  • Hidden
  • Hidden
  • Hidden
  • Hidden
  • Hidden

Related Posts

Knowledge Base

Plesk uses LiveChat system (3rd party).

By proceeding below, I hereby agree to use LiveChat as an external third party technology. This may involve a transfer of my personal data (e.g. IP Address) to third parties in- or outside of Europe. For more information, please see our Privacy Policy.

Search
Generic filters
Exact matches only
Search in title
Search in content
Search in excerpt