<p>I'm seeing the "http" directive not allowed error from the logs. I have mounted "nginx-basic.conf" file in "conf.d" folder as a config mount in Kubernetes.</p>

<p><strong>nginx-basic.conf-</strong></p>

<pre><code>http {
  server {
    location / {
      proxy_pass 35.239.243.201:9200;
      proxy_redirect off;
    }
  }

}
</code></pre>

<p>I'm not sure what is wrong with this. Could someone help me with pointing it out?</p>

Ben Abey
<p>You probably have another <code>http</code> directive in a base <code>nginx.conf</code> that includes everything under <code>/etc/nginx/conf.d</code></p>

<p>For example (<code>nginx.conf</code>):</p>

<pre><code>user www-data;
worker_processes auto;
pid /run/nginx.pid;

events {
        worker_connections 768;
        # multi_accept on;
}

http {

        ##
        # Basic Settings
        ##

        sendfile on;
        tcp_nopush on;
        tcp_nodelay on;
        keepalive_timeout 65;
        types_hash_max_size 2048;
        ...
        include /etc/nginx/conf.d/*.conf;
        include /etc/nginx/sites-enabled/*;
}
</code></pre>

<p>You can try removing the <code>http</code> directive:</p>

<pre><code>server {
  location / {
    proxy_pass 35.239.243.201:9200;
    proxy_redirect off;
  }
}
</code></pre>
