Can I Use Custom Server Blocks with the NGINX Ingress Controller?

0
7
Asked By CloudySky24 On

I'm trying to get a better understanding of how flexible the NGINX Ingress Controller is when it comes to modifying the underlying NGINX configuration. Specifically, I want to know if I can use files from "/etc/nginx/sites-available" or incorporate complete `server {}` blocks within the controller. From what I've gathered, the ingress-nginx controller generates its configuration dynamically and doesn't follow the traditional `sites-available` or `sites-enabled` structure. However, I've seen some references where custom NGINX configs included full server blocks, which had settings like `listen 443 ssl`, SSL certificates from "/etc/letsencrypt", and various `proxy_pass` directives. Before I dive deeper into troubleshooting, I just want to confirm a few things:
- Is loading configurations from "/etc/nginx/sites-available" an option for the ingress controller?
- Can I use standalone `server {}` blocks in this context?
- Or do I need to stick to using snippets and annotations for customizing NGINX's behavior? Any insights would be greatly appreciated!

2 Answers

Answered By TechieTommy On

You can't really use files like "/etc/nginx/sites-available" with the ingress controller. It's designed to work with annotations in the ingress resource instead. Also, the NGINX instances the controller manages are more like reverse proxies, not traditional web servers that would read from those config files.

Answered By OldCoder82 On

Just a heads-up, the project might not be actively maintained anymore. It's better to consider other options going forward, like Traefik, instead of building new systems on it.

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.