Created
November 29, 2017 02:31
-
-
Save yujunz/b917c42095bb6ac4935fb0a0e9afacee to your computer and use it in GitHub Desktop.
istio nginx frontend
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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