Using NGINX as a Reverse Proxy for an Application and Blog

1.5 hours
  • 2 Learning Objectives

About this Hands-on Lab

NGINX is useful beyond simply serving static content and works wonderfully as a reverse proxy in front of other backend services. In this activity, the student will set up NGINX as a reverse proxy for a simple web application and a WordPress blog. Being able to configure NGINX for use with a variety of application types allows you to use the right tool for the job (WordPress for blogging in this case) and provide a lot of business value.

Learning Objectives

Successfully complete this lab by achieving the following learning objectives:

Serve WordPress Content for blog.example.com

The student is asked to route traffic from blog.example.com to the locally installed WordPress application. PHP-FPM is listening on the socket at /var/run/php-fpm.sock and is the recommended FastCGI proxy destination.

Proxy Requests to Web Application for example.com

Requests for example.com should all be routed to the web application listening on port 8000.

Additional Resources

Your company has decided it wants to do more content marketing and is starting a blog. It would be costly to have web developers add a blog to the primary web application, so you've deployed a WordPress application for Marketing to add content to.

The WordPress application and primary web application reside on the same server. WordPress will be accessed from blog.example.com and the main application from example.com. Your primary application is running on port 8000 and the WordPress install sits at /var/www/blog listening on the socket /var/run/php-fpm.sock.

After you've configured NGINX to serve the right content for the right domain, Marketing can start blogging, and no developer resources need to be pulled away from the primary application.

What are Hands-on Labs

Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.

Sign In
Welcome Back!

Psst…this one if you’ve been moved to ACG!

Get Started
Who’s going to be learning?