-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Getting unknown directive "root" when trying to add configuration to serve content from specific directory #11086
Comments
This issue is currently awaiting triage. If Ingress contributors determines this is a relevant issue, they will accept it by applying the The Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/remove-kind bug I don't understand anything about the environment or the use case or practical steps to reproduce the problem. There is no clear definition of the problem. Wait till someone can understand and triage the issue, so the problem description is more clear /kind support |
I am trying to configure nginx to provide content from specific directory, i.e If i invoke root path (/) I need to show index.html. Below is my ingress yaml file
For this ingress I am getting below error I also went into nginx ingress controller pod, and added below snippet
Getting same error (Unknown directive "root") while reloadin nginx using "nginx -s reload" |
At the very least, you should look at the questions that are asked in the new bug report template. You have not answered any of the questions asked in the new issue template so readers have to guess what the heck is going on here, to begin with. And then you don't care to explain why you are talking about providing content from inside the controller. The controller has nothing to do providing your content from inside the controller pod Once you have edited the issue description here and answered all the questions that are asked in a new bug report template, please write a detailed description of why you are trying to provide content from inside the ingress-controller pod. This project is a ingress controller so look at the documentation and write proper issue description that is related to some feature mentioned in the documentation https://kubernetes.github.io/ingress-nginx/ After that you can re-open the issue so that readers can make comments based on useful data posted here. /close |
@longwuyuan: Closing this issue. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
please look at this : #8624 |
What happened:
I am trying to configure nginx to provide content from specific directory, i.e If i invoke root path (/) I need to show index.html.
while configuring server-snippet for this I am getting below error.
Below is my ingress yaml file
2024/03/11 06:56:57 [emerg] 955#955: unknown directive "root" in /tmp/nginx/nginx-cfg3003441674:276
nginx: [emerg] unknown directive "root" in /tmp/nginx/nginx-cfg3003441674:276
nginx: configuration file /tmp/nginx/nginx-cfg3003441674 test failed
What you expected to happen:
I am configuring below code in ingress resource:
I have placed landing page files in /usr/share/nginx/html. When I hit root path I need to show index.html.
NGINX Ingress controller version (exec into the pod and run nginx-ingress-controller --version.):
Kubernetes version (use
kubectl version
): v1.29.1Environment:
Cloud provider or hardware configuration:
OS (e.g. from /etc/os-release): Ubuntu 20.04.6
Kernel (e.g.
uname -a
): Linux 5.4.0-159-generic Fix TLS does not get updated when changed #176-Ubuntu SMP Mon Aug 14 12:04:20 UTC 2023 x86_64 x86_64 x86_64 GNU/LinuxInstall tools: Cluster is initialized using kubeadm
Please mention how/where was the cluster created like kubeadm/kops/minikube/kind etc.
Basic cluster related info:
kubectl version
: v1.29.1kubectl get nodes -o wide
How was the ingress-nginx-controller installed:
helm ls -A | grep -i ingress
helm -n <ingresscontrollernamespace> get values <helmreleasename>
kubectl describe ingressclasses
kubectl -n <ingresscontrollernamespace> get all -A -o wide
kubectl -n <ingresscontrollernamespace> describe po <ingresscontrollerpodname>
kubectl -n <ingresscontrollernamespace> describe svc <ingresscontrollerservicename>
Current state of ingress object, if applicable:
kubectl -n <appnamespace> get all,ing -o wide
kubectl -n <appnamespace> describe ing <ingressname>
Others:
kubectl describe ...
of any custom configmap(s) created and in useI am configuring below code in ingress resource:
I have placed landing page files in /usr/share/nginx/html. When I hit root path I need to show index.html.
How to reproduce this issue:
Anything else we need to know:
The text was updated successfully, but these errors were encountered: