Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more

On Rocky Linux or AlmaLinux, install the open-source NGINX RPM with dnf, start it with systemd, open HTTP/HTTPS in firewalld when required, and verify both local and remote access. The shortest supported path is:

sudo dnf update -y
sudo dnf install nginx -y
sudo systemctl enable --now nginx
sudo nginx -t

If the distribution package is unavailable or you need the vendor’s update stream, configure the official NGINX repository instead. The sections below show when to use each source, how to recover from common failures, and how to add a server block safely.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

What you are installing

Rocky Linux and AlmaLinux are RHEL derivatives, and NGINX documents both as supported targets for its Linux package instructions. The installable unit is the nginx RPM, managed with dnf (or the compatible yum command where it is provided).

There are two practical package sources:

  • The distribution stream (often called AppStream): normally requires the least configuration and follows the operating system’s packaging and update process.
  • The official NGINX repository: requires a repository file, but gives you a direct vendor stable stream and an opt-in mainline stream.

Neither choice is universally best. AppStream is usually the simplest operational choice. The official repository is useful when you specifically need NGINX’s vendor-maintained stream or want to choose between stable and mainline packages. Do not assume an exact package version without checking the repository for your operating-system major version and CPU architecture.

#1 Best Overall
Sale
Compressed Air Duster,130000RPM Super Power Cordless Air Duster,Rechargeable Brushless Blower,3 Gear Adjustable Blower with LED Light,Dust Remover for Computer/House/Outdoor/Car
  • Powerful Turbo Fan:CAGIWIRU Electric Air Duster have reached speed up to 130000RPM,Can efficient remove dust and debris.With LED light and Three Adjustable Speed to meet with different cleaning tasks.
  • With Attached USB C Fasting Charging cable.Charing 3 hours,Enjoy up to 240 minutes of use on the lowest setting, For third speed can use for 25mins.with four charging options to meet with your needs.
  • Wide Application: attached 5 different nozzles,making it suitable for a variety of scenes, such as car,pet, pc, keyboards, and other electronic devices. It also serves for office and home clean duster.
  • Handy Design & Portable:Cordless air duster electric nozzle is Light weight and small size, design and comfortable to hold and space saving, convenient to carry around. You can put it in your room or inside the car without taking up space.
  • Economical &Reusable: Built durable materials with a long-lasting battery,our CAGIWIRU air duster it's a sustainable alternative to disposable air cans.

Before you begin

Confirm the operating system

Run your normal host-identification command and confirm that the machine is Rocky Linux or AlmaLinux. The commands in this guide use dnf and should be run against the major release installed on the host.

Use an account with sudo

Installing packages, writing repository files, controlling systemd, and changing firewalld rules require administrative privileges. Every command that changes the system is shown with sudo.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Plan how clients will reach the server

Decide whether you will test from the same machine, from another host on the network, or through a public address. A successful local request proves that NGINX is listening locally; it does not prove that firewalld, a cloud firewall, routing, or DNS will allow remote traffic.

Choose a package source

Choice Configuration effort Stream selection Update source When it fits
Rocky Linux or AlmaLinux package stream (AppStream) Usually the least configuration Uses the distribution’s stream Operating-system package repositories When integration with the distribution and simple maintenance matter most
Official NGINX stable repository Create /etc/yum.repos.d/nginx.repo and verify its signing key Vendor stable stream Official NGINX repository with GPG checking enabled When you want the vendor’s stable package stream and direct vendor update control
Official NGINX mainline repository Same repository setup, with mainline selected explicitly Mainline is opt-in Official NGINX repository with GPG checking enabled When your change policy calls for the mainline stream and you have validated it for your environment

NGINX recommends configuring its official repository when you want the latest official release and more control over updates. That recommendation does not make mainline mandatory: stable is the default repository stream, while mainline must be selected deliberately.

Install the distribution package

1. Update package metadata and the host

Start by applying available package updates and refreshing the package state:

sudo dnf update -y

The command may update more than NGINX. Review your organization’s change policy before running it on a production machine, especially if the host has a maintenance window or a reboot requirement.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

2. Install NGINX

Try the distribution package first:

sudo dnf install nginx -y

If the transaction completes, continue to the systemd and validation steps. The package installs the NGINX daemon and its standard configuration layout; additional virtual-host files are conventionally placed under /etc/nginx/conf.d/.

Rank #2
EVEO® Screen Cleaner Spray Kit (Streak-Free) TV Screen Cleaner for Smart TV, Lcd, LEd, Oled | Computer Screen Cleaner Spray and Wipe Microfiber Cloth - TV, Monitor, Laptop, iPad, Car - 6.7oz 1 Pack
  • Screen Cleaner is Your Screen’s New Bestfriend! - EVEO is proud to present a screen cleaner that’s perfectly suited for your TV. Meet your new screen cleaner, computer screen cleaner, laptop cleaner, iPad cleaner, Macbook,tv cleaner or any other electronic device. Our screen cleaner spray and wipe along with the included plush microfiber cloth, easily removes dust, fingerprints & other smudges on the screen’s surface. Clean effectively for a streak-free screen
  • Gentle on your Screens - Our screen cleaner spray and wipes is compatible to be used even for the most sensitive LCD, LED, CRT, and OLED screens in proper use. Be at ease knowing that this product is compatible with all the major brands: LG, SONY, Samsung, Sharp, iPad, iPhone, Android screens, Kindle, PC monitors - we’ve got you covered! Can be used as LCD screen cleaner, tv cleaner, smart tv screen cleaner, and more
  • Premium Super Soft Plush Microfiber Cloth - Included in this efficient screen cleaning kit. This screen cleaner spray and wipe has our signature plush microfiber cloth specially designed to comply with screens and monitors and leave them streak-free. Has been shown to effectively absorbs stubborn stains, zero streaks, and no fiber shedding. Always use this together with our screen cleaner for the best results
  • Easy-to-Use Screen Cleaner Kit + microfiber cleaning cloth - The EVEO Screen Cleaning Kit will easily be your new favorite tool when it comes to taking care of the things you love most, quick and easy solution for a streak-free screen. Simply screw on the sprayer gun on the screen cleaner bottle. Spray the cleaning liquid onto the microfiber cloth, then wipe the screen until desired cleanliness & shine is achieved.
  • Quality Screen Care Kit Worth Purchasing - Enjoy a convenient Screen Cleaner anytime, anywhere you need it. Your satisfaction is our top priority. We stand behind the quality of our products and that’s why, you shouldn’t be worrying at all. We manufacture the Best Screen Cleaner. and can be used for laptop cleaning kit, laptop screen cleaner, tv screen cleaner for smart tv. MacBook screen cleaner, monitor cleaner or screen cleaner spray for electronic devices with microfiber cleaning cloth

3. Recover when no package is available

If dnf reports that no nginx package is available, NGINX’s installation guidance documents installing EPEL, clearing cached metadata, and retrying:

sudo dnf install epel-release -y
sudo dnf clean all
sudo dnf install nginx -y

Read the package-manager output rather than repeatedly retrying a failed transaction. If the package is still unavailable, use the official NGINX repository procedure below and confirm that its repository definition supports your installed operating-system major version and architecture.

Install from the official NGINX repository

1. Select the stream before changing repositories

The official repository uses stable as its default stream. Mainline is an opt-in stream. Choose one intentionally and record that choice in your change documentation; the appropriate stream depends on your compatibility requirements and update policy.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

2. Create the repository definition

Create /etc/yum.repos.d/nginx.repo using the repository definition from NGINX’s official package instructions. Repository URLs use release variables, so verify that the selected definition resolves to your Rocky Linux or AlmaLinux major version and the host’s architecture. Do not copy a repository stanza intended for a different release.

Keep GPG verification enabled. In the repository file, retain gpgcheck=1 and the signing-key configuration supplied by NGINX. Before accepting a key, compare its fingerprint with the fingerprint shown in the official NGINX package documentation. A key prompt is not a reason to bypass verification.

3. Install the package

After saving the repository file, install NGINX normally:

sudo dnf install nginx -y

If dnf asks to import a signing key, stop and verify that the fingerprint matches NGINX’s published value. If it does not match, decline the import and investigate the repository configuration or network path before proceeding.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
Sale
BladeHawks RGB Gaming Mouse Pad Extra Large Extended 31.5x12 Inch-Black | LED mouse pad with 14 lighting modes, covers keyboard & mouse, anti-slip rubber base, waterproof surface, USB powered
  • 【Large size】:Measuring 800 x 300 mm/ 31. 5×12 inches, which is wider and taller than others. Large mouse pad can perfectly fit your keyboard and mouse of any size, and there is also ample space for peripherals such as phones, tablets, etc.
  • 【LED backlight mouse pad】:Blade Hawks RGB mouse pad provides 7 static modes and 7 dynamic modes will give you the options you are looking for. Power-off memory function remembers the last lighting mode you selected. The super glow fiber Chroma will give you a colorful gaming setup that you want.
  • 【Anti-slip rubber base】:Made from Natural rubber, this gaming mousepad will firmly grip your desktop, allowing you to enjoy the ultimate precision in the games you are most passionate about. It also comes with a texture that enhances this ability even further.
  • 【Smooth and waterproof surface】: Micro-textured cloth surface, for extremely precise mouse control and a smooth movement. When liquid splashes on the gaming mouse pad, it forms water droplets and slides down. Will not delay your work or gameplay.
  • 【Plug and play】: This mouse and keyboard pad is powered by USB, plug and play, no driver required. One button control light modes. Press one time to change the lighting mode, press twice to change the brightness, press and hold about 3 seconds turn ON/OFF.

Start NGINX and make it persistent

Enable and start the service

Use systemd to start NGINX now and enable it for subsequent boots:

sudo systemctl enable --now nginx

Check the resulting unit state:

sudo systemctl status nginx

A running unit indicates that systemd started the process. It does not by itself prove that the intended server block loaded or that clients can reach the host, so continue with syntax and network tests.

Validate configuration before every reload

Run the built-in syntax check before changing a live configuration:

sudo nginx -t

A successful test reports that the syntax is valid and that the configuration test succeeded. If the test fails, do not reload. Correct the file named in the error, run sudo nginx -t again, and only then reload.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Open HTTP and HTTPS in firewalld

AlmaLinux’s guide notes that firewalld is enabled by default in its examples. Check whether it is active on your host. When it is filtering traffic, permanently allow the standard web services and reload the rules:

sudo firewall-cmd --permanent --add-service={http,https}
sudo firewall-cmd --reload

The first command writes persistent rules for ports associated with HTTP and HTTPS; the second loads them into the running firewall. If you are testing only plain HTTP, allowing HTTPS is not required for that test, but adding both services is the documented web-server setup when the host will serve both protocols.

Firewalld is only one possible network barrier. A hosting provider’s security group, an upstream firewall, NAT, or routing policy can still block remote requests even when the local firewalld rules are correct.

Rank #4
Sale
Vaydeer Wrist Rest for Keyboard and Mouse, Computer Ergonomic Wrist Support Pad, Soft Memory Foam Arm Cushion for Desk, Palm Hand Office Laptop Typing
  • 【Softer and More Comfortable】Vaydeer wrist rest has unique diamond pattern, which is the combination of softness and aesthetics. The materials of wrist rest are improved into higher quality memory foam and covered with silky smooth lycra. The computer wrist rest makes you as comfortable and cushiony as like rest your wrists on clouds.
  • 【Ergonomic Wrist Saver】The wrist rests for keyboard and mouse comes with a 17.32×3.15×0.83 inch keyboard wrist pad and a 5.94×3.15×0.83 inch mouse wrist support. Based on ergonomic design, the unique concave shape is the perfect fit for your wrist joints. The wrist rest pad fits most computer keyboards and laptops, improve hand and wrist posture, release your wrist and arm stress.
  • 【Non-Slip Rubber Bottom】Featuring an anti-skid silicone base on the bottom, this wrist keyboard support stays firmly in place on your desk, preventing the padding from sliding around, ensuring stable and consistent wrist support during extended computer sessions.
  • 【Better Experience & Pain Relief】Our keyboard arm rest is beneficial to alleviate the soreness caused by direct contact and friction between your arm and a hard desk surface, reducing the risk of wrist fatigue or carpal tunnel. The soft texture of memory foam can evenly distribute the pressure around your wrists and provide good support with just enough give.
  • 【Helpful in Multiple Scenarios】Whether you're working, studying, writing, typing, gaming, this keyboard and mouse rest combo is an essential accessory to add comfort and support to your hands and wrists. It’s also a great gift for men, women, family, friend, coworker, gamer, teacher, etc.

Test the installation locally and remotely

Local test from the server

Request only the response headers from the loopback address:

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
curl -I http://127.0.0.1/

This test checks that a process is answering on the local HTTP socket. If it fails, inspect the service and its journal:

sudo systemctl status nginx
sudo journalctl -u nginx

Look for a failed start, a syntax error, a port conflict, or a permission problem. Fix the reported cause, rerun sudo nginx -t, and restart or reload only after the test succeeds.

Remote test from another machine

From a client that should be able to reach the server, request the server’s address:

curl -I http://server-address/

Replace server-address with the address that the client is expected to use. A local success followed by a remote failure narrows the problem to reachability: check firewalld, any upstream or cloud firewall, routing, and whether the client is using the correct address. Do not change SELinux to solve a basic connectivity problem.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Add a server block safely

1. Create a file in the included directory

Rocky Linux’s guide shows the standard include path for additional server configuration: /etc/nginx/conf.d/*.conf. Put a site-specific server block in a file such as:

/etc/nginx/conf.d/example.conf

Use a separate file for each site or service so that a syntax error or later change is easy to identify. The exact directives depend on your application, hostnames, document root, and proxy design; do not paste a configuration intended for a different application without reviewing every path and upstream.

Best Value
Sale
Under Desk Cable Management Tray No Drill, Metal Mesh Cable Management Under Desk with Clamp Mount, 2 Hole Cable Tray with Wire Management and Cord Organizer for Home Office Standing Desk
  • 【No Drill Mounted】Cable management tray can be assembled in as little as 3 minutes or less-simply. Side clips easily clampe the edge of desk, pass through the holes on the sides, and secure excess cables with baskets. Desk cable management supports inward or outward installation to meet your needs in different scenarios, and provides you with great convenience when collecting and organizing wires.
  • 【Rubber Pad Protects Desk】Wire organizer under desk built-in soft rubber pads on the clamp protect your desk from scratches, so you will not damage your furniture or office.
  • 【Sturdy and Beautiful】Cord management under desk is made of high-quality carbon steel and holds about 15 lbs. The wire basket has 2 holes on each side of the tray to enable your cables to pass freely. Cable baskets are suitable for desk thickness use from 0.4" to 2.4".
  • 【Space Saving & Keep Organized】Desk cable management tray holds all your power cords, outlet strips, USB hubs and computer transformers hidden from your feet, and the data cables will not enter the vacuum cleaner to keep your desk clean and tidy. Desk wire organizer is also suitable for use in the kitchen and outdoors.
  • 【Reduce Safety Risks】Cable tray under desk keeps all plugs away from your kids, no more worry about tripping. Using 2 holes wire tray saves extra space, helps you easily cabling and wire protection. The mesh design is not easy to accumulate dust, but avoids safety accidents caused by messy wires.

2. Test before applying the change

After saving the server block, run:

sudo nginx -t

If the test reports an error, use the file and line information in the output to correct it. Keep the currently working configuration in place until the new file passes the test.

3. Reload without stopping the daemon

Once the syntax check succeeds, apply the configuration with a graceful reload:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
sudo systemctl reload nginx

Reloading asks the running service to read the new configuration without the unnecessary interruption of a full stop and start. If the reload fails, check sudo systemctl status nginx and sudo journalctl -u nginx, then restore or correct the file that caused the failure.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Troubleshooting by symptom

“No package nginx available”

  • Confirm the host is the Rocky Linux or AlmaLinux major release you intended to administer.
  • Install epel-release, clean cached metadata, and retry the package installation.
  • If the distribution stream still does not expose the package, configure the official NGINX repository for the correct release and architecture.
  • Do not disable GPG checking to make the transaction proceed.

The service will not start

  1. Run sudo systemctl status nginx and read the failure reason.
  2. Run sudo nginx -t to catch syntax and include-file errors.
  3. Read the unit journal with sudo journalctl -u nginx.
  4. Correct the named configuration, permission, or port issue, test again, and then start or reload NGINX.

Local requests work but remote requests fail

  • Confirm that firewalld permits the required service with the documented permanent rules and reload.
  • Check upstream or cloud firewall rules and security groups.
  • Verify that the client is using the server’s reachable address and that routing is correct.
  • Retest with curl -I http://server-address/ from the remote client.

A repository key prompt appears

Keep the transaction paused while you compare the displayed key fingerprint with the fingerprint published in NGINX’s official package instructions. Accept only a matching, expected key. A mismatch should be treated as a repository or delivery-path problem, not worked around by turning off signature verification.

A configuration change breaks reload

Never bypass nginx -t. Read the exact file and line in the error, correct the server block or include, test again, and reload only after a successful syntax check. If the service is already serving traffic, preserve the last known-good file while you repair the new one.

SELinux and security boundaries

Keep SELinux enforcing during installation and normal operation. Disabling it is not an installation shortcut and can hide a policy or labeling problem. If an application needs a documented SELinux policy adjustment, make that change deliberately and record why it is required; do not turn enforcement off merely because a request failed.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Likewise, retain repository signature checking and verify signing-key fingerprints. Package provenance and mandatory access controls are part of a maintainable Rocky Linux or AlmaLinux deployment, not optional cleanup after the service is running.

Updating and operating the installation

Know which stream you selected

With AppStream, NGINX updates arrive through the distribution repositories. With the official repository, updates follow the NGINX stable or mainline stream you selected. Document the source so another administrator knows where future packages will come from.

Use a repeatable change sequence

  1. Make the configuration change in the appropriate /etc/nginx/conf.d/*.conf file.
  2. Run sudo nginx -t.
  3. Reload with sudo systemctl reload nginx.
  4. Confirm service state with sudo systemctl status nginx.
  5. Test locally, then from a remote client when the change affects network access.

This sequence separates syntax errors from firewall and routing problems and gives you a clear recovery point when a change does not behave as expected.

Open-source NGINX versus NGINX Plus

The commands in this guide install the open-source nginx RPM. NGINX Plus is a separate commercial product with its own licensing and repository steps; do not treat its installation instructions as interchangeable with the open-source package procedure shown here.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Installation checklist

  • Rocky Linux or AlmaLinux major version and architecture confirmed.
  • sudo dnf update -y completed according to your maintenance policy.
  • sudo dnf install nginx -y succeeded, either from the distribution stream or the correctly configured official repository.
  • Stable versus mainline choice recorded when using the official repository.
  • GPG checking remains enabled and any signing-key fingerprint was verified.
  • sudo systemctl enable --now nginx completed.
  • sudo nginx -t passes before every reload.
  • Firewalld allows the required web services when it is active.
  • curl -I http://127.0.0.1/ succeeds locally.
  • A remote curl -I http://server-address/ succeeds from an authorized client.
  • Additional server blocks are stored under /etc/nginx/conf.d/ and tested before reload.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.