Skip to content

Instantly share code, notes, and snippets.

@yujunz
Created November 29, 2017 02:31
Show Gist options
  • Save yujunz/b917c42095bb6ac4935fb0a0e9afacee to your computer and use it in GitHub Desktop.
Save yujunz/b917c42095bb6ac4935fb0a0e9afacee to your computer and use it in GitHub Desktop.
istio nginx frontend
server {
listen 80;
server_name bookinfo.istio;
location / {
proxy_pass http://${GATEWAY_URL};
proxy_http_version 1.1;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
#!/bin/sh
export GATEWAY_URL=$(kubectl get po -n istio-system -l istio=ingress -n istio-system -o 'jsonpath={.items[0].status.hostIP}'):$(kubectl get svc istio-ingress -n istio-system -n istio-system -o 'jsonpath={.spec.ports[0].nodePort}')
site_conf=/etc/nginx/sites-enabled/bookinfo.istio
envsubst '${GATEWAY_URL}' <./bookinfo.istio.in >${site_conf}
ln -sf ${site_conf} /etc/nginx/sites-enabled/default
systemctl restart nginx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment