nginx-container
nginx-container copied to clipboard
Pod does not show logs for Nginx launch.
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/;
}
}
}
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;
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
Same here
@chainhead @josnin Is this still valid? See documentation https://github.com/sclorg/nginx-container/tree/master/1.24#environment-variables-and-volumes