Learn how to install the fast HTTP server Nginx and configure it as an HTTP/Proxy Server on your system.
Nginx is known for its high performance and stability. It can be installed with the following command:
[root@www ~]# dnf -y install nginx
After installation, proceed to configure Nginx.
Edit the Nginx configuration file:
[root@www ~]# vi /etc/nginx/nginx.conf
# Modify the server_name directive to your hostname
# Example line 41:
server_name www.emc.world;
Enable Nginx to start on boot and start the service:
[root@www ~]# systemctl enable --now nginx
If Firewalld is active, allow HTTP traffic, which uses port 80/TCP:
[root@www ~]# firewall-cmd --add-service=http
success
[root@www ~]# firewall-cmd --runtime-to-permanent
success
To confirm Nginx is correctly installed and running, access the default Nginx page from a web browser:
http://<your_server_ip_or_hostname>.You should see the Nginx default welcome page, indicating that Nginx is installed and serving web pages.