Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save rodrigoborgesdeoliveira/b193d1e54cff21f0e618221f7ce34dbd to your computer and use it in GitHub Desktop.
Save rodrigoborgesdeoliveira/b193d1e54cff21f0e618221f7ce34dbd to your computer and use it in GitHub Desktop.
An example of an ingress setup for a gateway on an nginx ingress on kubernetes.
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
annotations:
nginx.ingress.kubernetes.io/configuration-snippet: |
if ($http_env = "dev") { proxy_pass http://<service-name>.<service-namespace>.svc.cluster.local:<service-port>; } # Point directly to a service in the same cluster
if ($http_env = "staging") { proxy_pass https://staging.example.com; } # Or point to a URL
name: gateway
namespace: default
# Continue as usual pointing to the default service
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment