<p>I'm working on Kubernetes deployment services using minikube locally on my windows 10 machine, so when I expose my service which is an expressjs API I can reach it via: <code>localhost:3000</code></p>
<p><a href="https://i.stack.imgur.com/2s3ii.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/2s3ii.png" alt="enter image description here" /></a></p>
<p><a href="https://i.stack.imgur.com/EFDnF.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/EFDnF.png" alt="enter image description here" /></a></p>
<p>I want to expose that service on the network so I can test the API from another device (My mobile phone) to do that I installed Nginx to set a reverse proxy to forward all incoming requests on port 80 to <code>localhost:3000/api</code>  but when I hit localhost it shows the default page of Nginx ?</p>
<p><a href="https://i.stack.imgur.com/Hcsld.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Hcsld.png" alt="enter image description here" /></a></p>
<p>this is my nginx.conf</p>
<pre><code>#user  nobody;
worker_processes  1;

#error_log  logs/error.log;
#error_log  logs/error.log  notice;
#error_log  logs/error.log  info;

#pid        logs/nginx.pid;


events {
    worker_connections  1024;
}


http {
    include       mime.types;
    default_type  application/octet-stream;

    #log_format  main  '$remote_addr - $remote_user [$time_local] &quot;$request&quot; '
    #                  '$status $body_bytes_sent &quot;$http_referer&quot; '
    #                  '&quot;$http_user_agent&quot; &quot;$http_x_forwarded_for&quot;';

    #access_log  logs/access.log  main;

    sendfile        on;
    #tcp_nopush     on;

    #keepalive_timeout  0;
    keepalive_timeout  65;

    #gzip  on;

    server {
        listen       80;
        server_name  localhost;
        location / {
                proxy_pass http://localhost:3000/api/;
                }

        
        #
        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }

        # proxy the PHP scripts to Apache listening on 127.0.0.1:80
        #
        #location ~ \.php$ {
        #    proxy_pass   http://127.0.0.1;
        #}

        # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
        #
        #location ~ \.php$ {
        #    root           html;
        #    fastcgi_pass   127.0.0.1:9000;
        #    fastcgi_index  index.php;
        #    fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;
        #    include        fastcgi_params;
        #}

        # deny access to .htaccess files, if Apache's document root
        # concurs with nginx's one
        #
        #location ~ /\.ht {
        #    deny  all;
        #}
    }


    # another virtual host using mix of IP-, name-, and port-based configuration
    #
    #server {
    #    listen       8000;
    #    listen       somename:8080;
    #    server_name  somename  alias  another.alias;

    #    location / {
    #        root   html;
    #        index  index.html index.htm;
    #    }
    #}


    # HTTPS server
    #
    #server {
    #    listen       443 ssl;
    #    server_name  localhost;

    #    ssl_certificate      cert.pem;
    #    ssl_certificate_key  cert.key;

    #    ssl_session_cache    shared:SSL:1m;
    #    ssl_session_timeout  5m;

    #    ssl_ciphers  HIGH:!aNULL:!MD5;
    #    ssl_prefer_server_ciphers  on;

    #    location / {
    #        root   html;
    #        index  index.html index.htm;
    #    }
    #}

}
`
</code></pre>

<p>A few things could be happening here:</p>
<ol>
<li><p>After the Nginx configuration changed, the stop and reload of the application was not performed; this is necessary to load the new configuration and is performed with the commands <code>nginx -s stop</code>, and then <code>nginx -s reload</code>.</p>
</li>
<li><p>Accidentally running multiple instances: if for any reason the command <code>start nginx</code> was run more than once, you will have a process running for each time and cannot kill them with the <code>nginx -s stop</code> command; in this case, you will need to kill the processes on the Task Manager or restart the Windows system.</p>
</li>
<li><p>Be aware that Nginx for Windows is considered a <em>beta</em> version and it has some performance and operability issues, as stated in the following documentation [1].</p>
</li>
</ol>
<p>I recommend switching to a Linux system which fully supports Minikube and Nginx. Your scenario has been replicated on an Ubuntu VM and is working as expected.</p>
<p>[1] <a href="http://nginx.org/en/docs/windows.html" rel="nofollow noreferrer">http://nginx.org/en/docs/windows.html</a></p>
