nginx-container icon indicating copy to clipboard operation
nginx-container copied to clipboard

Pod does not show logs for Nginx launch.

Open chainhead opened this issue 6 years ago • 4 comments

I have a simple nginx.conf at the root of my git repository. I want to launch Nginx in a pod with this command: oc new-app registry.access.redhat.com/rhscl/nginx-114-rhel7~https://github.com/user/repo.git

The build and deployment configuration seem to have gone fine. However, the pod does not show any log output at all! How do I verify if the launch is successful or not?

nginx.conf

events { }

http {
    log_format main '$time_iso8601 - $remote_addr - "$http_user_agent" - "$request" - $request_id '
    '- $status - $body_bytes_sent - $request_time ';

    upstream registry {
        least_conn;
        server localhost:3000;
    }

    server {
        location / {
            proxy_set_header X-Nginx-Header $request_id;
            proxy_pass http://registry/;
        }
    }
}

chainhead avatar Sep 26 '19 02:09 chainhead

Hum, I think you should get access & error logging by default. Can you try adding something like the below to your nginx.conf? Does the build log show any errors?

error_log /var/log/nginx/error.log;

notroj avatar Sep 26 '19 07:09 notroj

I have the same issue, except that I do not have a special conf file, my image contains only an HTML page and some images:

FROM registry.access.redhat.com/rhel8/nginx-118:1

COPY build/docs/asciidoc/ ./

# Run script uses standard ways to run the application
CMD nginx -g "daemon off;"

And the pod logs in OpenShift stays empty

Xendar avatar Mar 10 '21 16:03 Xendar

Same here

josnin avatar Apr 03 '22 15:04 josnin

@chainhead @josnin Is this still valid? See documentation https://github.com/sclorg/nginx-container/tree/master/1.24#environment-variables-and-volumes

phracek avatar Apr 18 '24 12:04 phracek