server {
  listen 80;
  
  # Docker internal dns server
  resolver 127.0.0.11;
  
  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 http://api-golang:8080/;
        proxy_pass $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 http://api-node:3000/;
        proxy_pass $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;
}