The system admins team of xFusionCorp Industries needs to deploy a new application on App Server 1 in Stratos Datacenter. They have some pre-requites to get ready that server for application deployment. Prepare the server as per requirements shared below

Tasks:
1- Install and configure nginx on App Server 1.

ssh tony@stapp01
sudo su 
dnf install nginx -y
systemctl start nginx

2 - On App Server 3 there is a self signed SSL certificate and key present at location /tmp/nautilus.crt and /tmp/nautilus.key. Move them to some appropriate location and deploy the same in Nginx.

mv /tmp/nautilus.crt /etc/pki/tls/certs
mv /tmp/nautilus.key /etc/pki/tls/private/
cd /etc/nginx
vi nginx.conf

#Within the config make the following changes 
#add ip address of server to server_name

    server {
        listen       80;
        listen       [::]:80;
        server_name  172.16.238.10;
        root         /usr/share/nginx/html
        
#uncomment tls, add certificate and key locations and ip address

Settings for a TLS enabled server.

    server {
        listen       443 ssl http2;
        listen       [::]:443 ssl http2;
        server_name  172.16.238.10;  <-- This
        root         /usr/share/nginx/html;

        ssl_certificate "/etc/pki/tls/certs/nautilus.crt"; <-- This
        ssl_certificate_key "/etc/pki/tls/private/nautilus.key"; <-- This
        ssl_session_cache shared:SSL:1m;
        ssl_session_timeout  10m;
        ssl_ciphers PROFILE=SYSTEM;
        ssl_prefer_server_ciphers on;

        # Load configuration files for the default server block.
        include /etc/nginx/default.d/*.conf;

        error_page 404 /404.html;
            location = /40x.html {
        }

        error_page 500 502 503 504 /50x.html;
            location = /50x.html {
        }
    }

}


systemctl restart nginx
systemctl status nginx

3 - Create an index.html file with the content Welcome! under Nginx document root

cd /usr/share/nginx/html
rm -rf index.html
vi index.html
Welcome!
# Save the file 

nginx -t # Optional, but this command is used to test and validate the nginx config without having to reload or restart the server.

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

4 - For final testing try to access the App Server 1 link (either hostname or IP) from jump host using curl command. For example curl -Ik https://<app-server-ip>/.

# From jump host
curl -Ik https://stapp01
HTTP/2 200 
server: nginx/1.20.1
date: Wed, 10 Sep 2025 12:53:21 GMT
content-type: text/html
content-length: 9
last-modified: Wed, 10 Sep 2025 12:52:11 GMT
etag: "68c1747b-9"
accept-ranges: bytes