Rate This Document
Findability
Accuracy
Completeness
Readability

Verifying Nginx

Verify that the HTTPS and HTTP functions of Nginx are configured correctly and that Nginx is running properly by checking the port, checking the HTML file, and using the curl command.

  1. Check the Nginx listen port. 20000 is the HTTPS listen port and 10000 is the HTTP listen port.
    1
    2
    3
    netstat -anpt | grep 10000
    netstat -anpt | grep 20000
    netstat -anpt
    

  2. View the Nginx HTML file.
    1
    ll /usr/local/nginx/html/
    

    For Nginx 1.14.2 or Nginx 1.19.3 installed using the mirror site RPM package on CentOS 7.6 or CentOS 8.1, run the following command to check Nginx:

    ll -h /usr/share/nginx/html
  3. Verify that the HTTPS function is correctly configured.

    Access the Nginx HTML page using the curl command.

    1
    curl -k https://127.0.0.1:20000/index.html
    

    If "Welcome to nginx!" is displayed, the HTTPS function is configured successfully.

  4. Verify that the HTTP function is correctly configured.

    Access the Nginx HTML page using the curl command.

    1
    curl http://127.0.0.1:10000/index.html
    

    If "Welcome to nginx!" is displayed, the HTTP function is configured successfully.