title: Why outgoing requests from app running on nginx not hit Kubernetes services
body: <p>I deployed an application running on nginx in Kubernetes, it's a simple static <code>index.html</code>. I defined a button with a url to <code>http://backservice:8080/action</code>. <code>backservice</code> is a k8s service backing a Spring application. </p>
  
  <p>The problem is, when I click on that button, nothing happens. <code>backservice</code> is not hit. I expect a <code>CORS</code> error but it seems like nginx blocks all outbound requests. I don't want to proxy the backend service into nginx. </p>
  
  <p>Nginx config:</p>
  
  <pre><code>user  nginx;
  worker_processes  auto;
  error_log  /var/log/nginx/error.log warn;
  pid        /var/run/nginx.pid;
  events {
      worker_connections  1024;
  }
  http {
      include       /etc/nginx/mime.types;
      default_type  application/octet-stream;
  
      log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                        '$status $body_bytes_sent "$http_referer" '
                        '"$http_user_agent" "$http_x_forwarded_for"';
  
      access_log  /var/log/nginx/access.log  main;
  
      sendfile        on;
      #tcp_nopush     on;
  
      keepalive_timeout  65;
  
      #gzip  on;
  
      include /etc/nginx/conf.d/*.conf;
  }
  </code></pre>
  
  <p>Server conf:</p>
  
  <pre><code>server {
      listen       80;
      server_name  _;
      root /usr/share/nginx/html; 
  
      location / {
          index  index.html index.htm;
          try_files $uri $uri/ /index.html;
      }
  
      location /svg/ {
      }
  
      location /assets/ {
      }
  
      error_page   500 502 503 504  /50x.html;
      location = /50x.html {
      }
  }
  </code></pre>
  
  <p>The <code>backendservice</code> is in the same namespace as the nginx app.</p>