add kubernetes configuration

This commit is contained in:
sid palas
2023-02-10 09:54:56 -05:00
parent 4b29fb6534
commit f8dda04c6f
8 changed files with 184 additions and 1 deletions

View File

@ -0,0 +1,37 @@
server {
listen 80;
# Kubernetes dns server
resolver kube-dns.kube-system.svc.cluster.local valid=5s;
location /ping {
access_log off;
add_header 'Content-Type' 'text/plain';
return 200 "pong";
}
location /api/golang/ {
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_http_version 1.1;
set $api_golang_upstream api-golang.default.svc.cluster.local:8080/;
proxy_pass http://$api_golang_upstream;
}
location /api/node/ {
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_http_version 1.1;
set $api_node_upstream api-node.default.svc.cluster.local:3000/;
proxy_pass http://$api_node_upstream;
}
location / {
root /usr/share/nginx/html;
index index.html index.htm;
try_files $uri $uri/ /index.html =404;
}
include /etc/nginx/extra-conf.d/*.conf;
}