Skip to content
🚀 Limited-time offer $130 for Lifetime Pro access. Buy once and use forever

Status List

Uptime & Status Pages

Contents

nginx logo

NGINX Configuration Guide

Own a website, want to get alerts when it’s not working?
Consider trying out Status List for free. We have thousands of less-stressed customers who rely on us.

  • What is NGINX?

    NGINX is a high efficiency load balancer, request manipulator and static file server. The high efficiency comes from it's event-based architecture (as opposed to competing threaded or process-driven approaches).

NGINX is fairly straightforward to install and provides a lot of punch right out of the box. Let’s dive in and get started!

Quickstart

Install the NGINX package from your favorite package manager. Here’s an example with yum:

				
					yum install -y nginx
				
			

Create a directory at /etc/nginx/sites-available and /etc/nginx/sites-enabled for our site-specific configurations.

Open the configuration file created in /etc/nginx/nginx.conf. Include the following line at the end of the http {} configuration block: 

				
					include /etc/nginx/sites-enabled/*;
				
			

Start your NGINX service using the service start command. Configure nginx to auto-start using chkconfig on.

				
					service nginx start
chkconfig nginx on
				
			
Ready to know about downtime before your customers?
 
Status List delivers uptime monitoring and professional hosted status pages for sites of all shapes and sizes.

Trusted by 1000+ companies

Adding a Site

Create a new file in /etc/nginx/sites-available called mydomain.com.conf. This is where we’ll place your domain-specific configuration. To make the site enabled, create a symbolic link to your configuration in the /etc/nginx/sites-enabled directory. Here’s an example:

				
					# /etc/nginx/sites-available/statuslist.app.conf
server {
    listen 80;
    server_name statuslist.app;
    root /opt/statuslist/www;
    
    location / {
        try_files $uri $uri/
    }
}

cd /etc/nginx/sites-enabled
ln -s statuslist.app.conf ../sites-available/statuslist.app.conf
				
			

NGINX Config Test

It’s important to test your config before you reload NGINX. If you have something wrong, NGINX will stop operating and your site will go down. It’s really easy to test your config. Run the nginx -t command and NGINX will print the validation results. See below for an example:

				
					nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
				
			

You may also enjoy

Learn to set up the NGINX status page with for real-time server performance monitoring and seamless integration. Let's get your status page up and running!
It's important to test your NGINX configuration to prevent downtime. Fortunately it's really easy to test your configuration before reloading.
NGINX makes it easy to run Laravel on a production web server. The setup has a few steps, but it's pretty straight forward. Let's get your app into production!
NGINX is fairly straightforward to install and provides a lot of punch right out of the box. Let's dive in and get started!
Config variables are a powerful tool to control how NGINX routes requests. HTTP request, header and env variables give us precise control on request routing.
The server_name config directive tells NGINX how to route client requests. server_name can match multiple domains, split out requests and work on localhost.