Can nginx-ingress return a html content direct? #4494
Replies: 6 comments
-
Hi @xuziheng1002 thanks for reporting! Be sure to check out the docs and the Contributing Guidelines while you wait for a human to take a look at this 🙂 Cheers! |
Beta Was this translation helpful? Give feedback.
-
Hi @xuziheng1002 , any application (html or otherwise) should be exposed using deployment, service and ingress/virtual-server using a docker image, see:
These can be inserted in configmap and/or Ingress. |
Beta Was this translation helpful? Give feedback.
-
Also, consider something like this: https://docs.nginx.com/nginx-ingress-controller/configuration/virtualserver-and-virtualserverroute-resources/#actionreturn the ingress controller is still NGINX. And we allow different ways for you to extend it which supports you customizing in a way that works for you. |
Beta Was this translation helpful? Give feedback.
-
yes, I agree with your point of view. But I wish to remove unnecessary nodes in the request chain. Because we are deploy our app on OSS(Object Storage Service, a cloud service of storage) so I think the nginx pod is unnecessary if ingress can storage index.html file. |
Beta Was this translation helpful? Give feedback.
-
yes, that is grate solution for me, |
Beta Was this translation helpful? Give feedback.
-
I think of it this way. NGINX has personalities. Yes, those include web server, proxy, cache, api gateway, and so forth. All that said, we do have customers that use it in all kinds of ways and some that even ignore all the value we bring through YAML objects and other optimizations - because for them the key value is the K8s API integration itself. And you know what, that is okay. I will also say that these are generally advanced NGINX users as well. They are familiar with nginx.conf and very comfortable and tend to use advanced configuration knobs and tuning. I noticed a comment about storage. Sure, the ingress controller could take your html and write it locally to disk and serve it. You might be better served all up to present a shared volume to the entire deployment, mounted at a specific path and mapping your configuration path to that. Then, all your artifacts remain unique and most likely managed in a method like you do today. It is kind of better of both worlds. K8s take care of the volume attach, sharing, and all that in this case. |
Beta Was this translation helpful? Give feedback.
-
If I want to return html content by nginx-ingress, how can I do?
like as:
can I set any html content into nginx-ingress (with configmap? or snippets)
Beta Was this translation helpful? Give feedback.
All reactions