Documentation

Visit Our xCloud Knowledge Base

Here is your one-stop source for in-depth articles, FAQs, and tutorials for you to excel at hosting & managing your websites.


How To Configure Custom NGINX In xCloud?

NGINX is a top choice for web servers for its adaptability and strength. Many online services and applications use NGINX and customize it to boost their system’s efficiency, secure their data, and add new features. However, you might find it challenging to configure custom NGINX settings, as it often requires manual edits in the Linux terminal.

But, with xCloud, you can simplify this process. If you add a custom NGINX in xCloud, it lets you easily modify NGINX settings right from the xCloud dashboard, without using any extra command lines.

Understanding The NGINX Config #

NGINX is an open-source web server that provides reverse proxy, load balancing, and caching capabilities. It has HTTPS server capabilities and is primarily intended for optimal performance and stability.

In xCloud, the NGINX server settings are customizable through configuration files in the /etc/NGINX/ folder. The main configuration file can be located at /etc/NGINX/xcloud-conf.

Configure Custom NGINX In xCloud: A Step-By-Step Guide #

With xCloud’s Custom NGINX Config feature, you can add a new configuration directly from the xCloud dashboard. Here, you can add custom configurations for before, after, and inside server blocks. Follow the guide to learn how you can configure custom NGINX in xCloud.

Step 1: Navigate To The NGINX Tab In xCloud #

Log in to your xCloud dashboard and choose the website for which you want to add a custom NGINX. From the left navigation menu, click on the NGINX option.

Configure Custom NGINX

Step 2: Add A Custom NGINX #

From this tab, you need to tap the ‘Add a New Config’ button to configure a custom NGINX. You can run and debug a custom config or save this for later use purposes.

Configure Custom NGINX

You can choose one from 3 NGINX types: Before Server Block, Inside Server Block, and After Server Block. You can then choose a file name, ‘Run & Debug’ a custom NGINX, or ‘Save Config’.

  1. If you choose the ‘Before Server Block’ and set a Config File Name, the Config will be generated as /etc/NGINX/xcloud-conf/(sitename)/before/(Config File Name).
  2. For ‘Inside Server Block’ and a Config File Name, the Config will be generated as /etc/NGINX/xcloud-conf/(sitename)/server/(Config File Name).
  3. For ‘After Server Block’ and a Config File Name, the Config will be generated as /etc/NGINX/xcloud-conf/(sitename)/after/(Config File Name).

For example, if you choose the ‘Inside Server Block’ and set the Config File Name as ‘rankmath’ for the site ‘summer-star-195.xcloud.name’, the config will be generated as /etc/NGINX/xcloud-conf/summer-star-195.xcloud.name/server/rankmath.conf.

Now, using the Config Content below for example:

# START NGINX Rewrites for Rank Math Sitemaps
rewrite ^/sitemap_index.xml$ /index.php?sitemap=1 last;
rewrite ^/([^/]+?)-sitemap([0-9]+)?.xml$ /index.php?sitemap=$1&sitemap_n=$2 last;
rewrite ^/([a-z]+)?-sitemap\.xsl$ /index.php?xsl=$1 last;
# END NGINX Rewrites for Rank Math Sitemaps

Configure Custom NGINX

You can then choose to ‘Run & Debug’ or ‘Save Config’.

If you are using Custom NGINX for HideMyWP, make sure to change your settings in the plugin like this, as shown below.

Configure Custom NGINX

If your custom NGINX command and configurations are okay, you will see a green message upon clicking the ‘Run & Debug’.

Configure Custom NGINX

However, if there are some issues with your configuration and command, you will see a red message.

Configure Custom NGINX

Once you add a custom NGINX config successfully, it will be listed on the ‘Custom NGINX Config’ tab. From here, you can edit or delete a config. Additionally, you can preview your configuration.

Configure Custom NGINX

Custom NGINX Templates #

For now, we are offering built-in custom NGINX support for Rankmath and Hide My WP on the xCloud dashboard. That means, If your website has the Rankmath or Hide My WP plugins installed, you can choose from the ‘Select Template’ list and you’re all good to go. Or else, you can choose ‘Use My Own Config’ to run your config manually. However, we will be gradually adding more plugins.

Configure Custom NGINX

That is how easily you can configure custom NGINX in xCloud.

Still stuck? Contact our dedicated support team for any of your queries.

What are your feelings
Updated on April 8, 2024

Server Name

RAM

SSD

xCloud Provider Price/m
(For LTD users)

VULTR Price/m

DO Price/m

Newcomer

1GB

25GB

$4.50

$5.00

$6.00

Basic

2GB

55GB

$9.00

$10

$12.00

Standard

4GB

80GB

$18.00

$20

$24.00

Professional

8GB

160GB

$36.00

$40

$48.00

Business

16GB

320GB

$72.00

$80

$96.00

Server Name

RAM

SSD/NVMe

xCloud Provider Price/m
(For LTD users)

VULTR Price/m

DO Price/m

Lite

1GB

32GB

$5.40

$6.00

$8.00

Personal

2GB

88GB

$16.20

$18.00

$24.00

Growing

4GB

128GB

$21.60

$24.00

$32.00

Elite

8GB

256GB

$43.20

$48.00

$64.00

Titanium

8GB

384GB

$86.40

$96.00

$96.00

Ultimate

32GB

512GB

$172.80

$192.00

$192.00