Configuring NGINX for Managed WordPress

Running a WordPress site can be incredibly simple and used right out of the box, but you may need to customize or add specific files in order to get the most out of your site. Our Managed WordPress customers can include custom NGINX configurations for individual sites, because we know that adding simple redirects or adjusting browser cache settings are actions that many of our Managed WordPress users do on a regular basis. Read on to learn how you can use this functionality for your own site.

On the Managed WordPress platform, custom configuration files are read from the NGINX folder within the site’s home directory. Any file ending with .conf will be read into NGINX on reload or restart, so a file called ~/nginx/user.conf.sample is provided as a placeholder.

While you can create and edit these files, it is necessary that you reach out to our Managed WordPress Support team to reload the NGINX configuration. This will allow us to test the file configuration and confirm that there are no errors or warnings. Because your site performance and uptime is important, the Managed WordPress support team will manually review files to check for potentially irregular and harmful configurations.

Although the primary use of this feature is for configuring redirects at the NGINX level. you may also set custom browser cache expiration times for static files. Any configurations beyond those described below are considered best effort for support.

An example of simple redirects

# Simple redirect to an individual page
location /example-redirect-123 {
add_header X-Redirect-By "Yoast SEO Premium";
return 301 /example-redirect;
}

# Rewrite all urls under an old path to a new path
location /category/old-category {
rewrite ^/category/old-category/(.*)$ /category/new-category/$1 permanent;
}

An example of adjust browser cache settings

# Reduces js and css cache times to a single day instead of the MWP default of 1 year.
location ~* \.(?:css|js)$ {
expires 24h;
access_log off;
add_header Cache-Control "public";
}

Configuring NGINX

  1. Log into the site via SSH.:ssh/sftp credential section in Managed WordPress portal highlighted
  2. Navigate to the NGINX directory located in the home directory.
    s150@default:~$ pwd
    /home/s150
    s150@default:~$ cd nginx
    s150@default:~ngingx$ ls
    user.conf.sample
    s150@default:~/nginx$
  3. Next, create a file ending in .conf:
    s150@default:~/nginx$ touch redirects.conf
    s150@default:~ngingx$ ls
    redirects.conf user.conf.sample
    s150@default:~/nginx$

    In this example, we are using redirects.conf, but you can name it anything you’d like, just make sure you remember the file name.
  4. Then modify the file with the configuration changes:
    s150@default:~/nginx$ vi redirects.conf
    s150@default:~ngingx$ cat redirects.conf
    # Limited to directives valid in the server block context
    # All files ending in '.conf' in this directory will be loaded
    # Please contact support to have them reload the nginx config files
    # for changes to go into effect.# Configure redirects
    #
    loacation /example-redirect-123 {
    add_header X-Redirect-By "Yoast SEO Premium";
    return 301 /example-redirect;
    }
    s150@default:~/nginx$
  5. Lastly, contact support to request review and reload of the config. You can easily reach our Managed WordPress support team by opening a chat or ticket through your Managed WordPress portal, or by calling our team at 1(833)845-4527 or 1(517)322-0434.

Featured Video: How to Add a Site to Liquid Web’s Managed WordPress

In this Knowledge Base article we feature a tutorial video provided by AJ Morris, our Managed WordPress product manager. In this video AJ will show us how simple it is to set up a site in your Managed WordPress Portal.

Whether you’re building a site from scratch or migrating one over, this will be a great place to start. Continue reading “Featured Video: How to Add a Site to Liquid Web’s Managed WordPress”

Navigating Your Settings Page in Managed WordPress Portal

The Settings page for Managed WordPress Portal gives you access to change your profile and billing information, changing the timezone for your dashboard, and the ability to view your passphrase for authenticating your account when contacting our Heroic support team. Continue reading “Navigating Your Settings Page in Managed WordPress Portal”

Using Bulk Optimization in Managed WordPress Portal

One of the biggest reasons for poor web page performance, are images being added to sites that are far larger than needed. Managed WordPress Portal partnered with TinyPNG to provide a solution for site slowness due to over-sized photos. The Compress JPEG & PNG images plugin from TinyPNG is included in your hosting package, free of charge. This plugin allows you to be proactive and solve the technical burden of getting your site to load up quickly.

Continue reading “Using Bulk Optimization in Managed WordPress Portal”

Using Cloudflare with Your Managed WordPress Portal

If you have enabled Cloudflare for a site in your Managed WordPress Portal, you may run into an issue where you are unable to update the domain name. When you attempt to change the domain name to the one you want visible to the customer, an error message will show in your site dashboard. Continue reading “Using Cloudflare with Your Managed WordPress Portal”

Using the Visual Comparison Tool in Managed WordPress Portal

Managed WordPress Portal provides you an easy way to view the visual changes to your website when you update plugins. With the Visual Comparison Tool, your Managed WordPress Portal will create a staging site, update your plugins and give you the ability to see what changes (if any) the plugin update made to your site before it goes live. If there are no visual changes to the site, your plugins will automatically update on the live site. Continue reading “Using the Visual Comparison Tool in Managed WordPress Portal”

Adding and Deleting Users in Managed WordPress Portal

Just as in your WordPress site and your Liquid Web account, you can create users in the Managed WordPress Portal to help you manage all your sites. This person can do most of the same functions as you. They can organize the sites in your portal by tagging and labeling, create stencils of your sites and look at the visual comparison tool and push updates. The only thing a user cannot do is create new users. Continue reading “Adding and Deleting Users in Managed WordPress Portal”

Organizing Your Sites in Managed WordPress Portal

Managed WordPress Portal offers you the ability to organize your sites and find them quickly, create custom tags and disable Varnish caching all from your portal. Let’s take a look at the options you have to organize your sites your way, giving you the flexibility and customization you need to manage your sites efficiently. From your Managed WordPress Portal, you can:

Continue reading “Organizing Your Sites in Managed WordPress Portal”

Upgrading to PHP 7 in Managed WordPress Portal

PHP 7 is the newest release of PHP, replacing PHP 5.6 and lower. It was released in December 2015 and as of January 2017 PHP 5.6 is End of Life. This means that PHP 5.6 is only being supported for security issues, no other support will be given. With this in mind, Managed WordPress Portal gives you an easy upgrade tool so that you can update your sites to PHP 7. The upgrade tool will scan your entire site and let you know if your site is compatible with the upgrade. If not, it will send you an email to let you know what to update in your site to make your upgrade seamless. We will walk you through upgrading to PHP 7.0 in this article. Continue reading “Upgrading to PHP 7 in Managed WordPress Portal”