UNCLASSIFIED - NO CUI

Skip to content

NGINX expects static content in "/etc/nginx/html/" (not "/usr/share/nginx/html")

Summary

Container will not healthily start because it will give the following error:

"/etc/nginx/html/index.html" is not found (2: No such file or directory), client: 127.0.0.1, server: localhost, request: "HEAD / HTTP/1.1", host: "localhost:8080"

Steps to reproduce

docker run --name nginx-ib -p 8080:8080 -p 8443:8443 registry1.dso.mil/ironbank/opensource/nginx/nginx:1.21.1
docker exec -it nginx-ib bash

What is the current bug behavior?

"/etc/nginx/html/index.html" is not found (2: No such file or directory), client: 127.0.0.1, server: localhost, request: "HEAD / HTTP/1.1", host: "localhost:8080"

What is the expected correct behavior?

Properly serving the static content when HTTP requests are made

Relevant logs and/or screenshots

Above

Possible fixes

RUN cp -r /usr/share/nginx/html /etc/nginx/html

Defintion of Done

  • Bug has been identified and corrected within the container

/cc @ironbank-notifications/bug

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information