System Status
Buy Now
  • Email & Apps
  • Office 365
Login
  • MyRackspace Portal
  • Cloud Control Panel
  • Rackspace Webmail Login
  • Cloud Office Control Panel
  • Support Home
  • How-To
  • Developer Documentation
  •  Blogs 
    • Expert Insights Tech Blog
    • Rackspace Blog
    • Solve: Thought Leadership

Support Network

End-to-End Multicloud Solutions.   Solving Together.™   Learn more at Rackspace.com

How–To Home

Cloud Servers

  • Introduction
  • FAQ
  • All Articles

Install Nginx on Fedora

Last updated on:  2021-04-22

Authored by:  John Garcia


Nginx® is a web-server service with as much market share as Apache® because of its excellent performance and flexible feature set. This guide describes how to install Nginx and discusses the next steps for setting up Nginx to serve your site or application.

Prerequisites

You need a Linux® server running Fedora®.

Install Nginx on Fedora

Nginx is available in the default repositories for most popular Linux® distributions, including Fedora. To install Nginx, run the following dnf package-manager command:

sudo dnf install nginx

Enter y at the prompt to confirm that you want to install the package.

After the installation completes, run the following commands to enable and start the service. These commands start Nginx and configure it to start up when the server does.

sudo systemctl enable nginx
sudo systemctl start nginx

Open the firewall for Nginx

By default, Nginx listens on the default ports for HTTP and HTTPS traffic (Ports 80 and 443). However, this does not mean that it receives traffic because the firewall on the system also needs to allow traffic on these ports. Use the following commands to add the ports necessary for your site by adding the HTTP and HTTPS services:

sudo firewall-cmd --permanent --add-service=http
sudo firewall-cmd --permanent --add-service=https

Then reload firewalld to apply the new settings:

sudo firewall-cmd --reload

Test Nginx

After you install the package and open the firewall port or ports, Nginx should display its default web page. You can see this by typing your IP address in your web browser. You should see a splash page with the Nginx logo and a “Welcome to Nginx” message. If you do not see this, double-check that the IP address is correct, Nginx is running, and the firewall settings are correct.

Next steps

You can now use Nginx to start serving your application or website. Use the default configuration to serve a site by putting its content in the /var/www/html directory in your filesystem. If you want to serve more than one site, we recommend that setting Nginx server blocks to accommodate this need.

Share this information:

©2020 Rackspace US, Inc.

Except where otherwise noted, content on this site is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License

See license specifics and DISCLAIMER

About Rackspace
  • About
  • Customer Stories
  • Events
  • Programs
Blogs
  • The Rackspace Blog
  • Expert Insights Tech Blog
  • Solve: Thought Leadership
  • News
  • Contact Information
  • Legal
  • Careers
Site Information
  • Style Guide for Technical Content
  • Trademarks
  • Privacy Statement
  • Website Terms
Support Network
  • Support Network Home
  • Rackspace How-To
  • API Documentation
  • Developer Center
  • ©2020 Rackspace US, Inc.