0

I am running an nginx (v. 1.20.1) proxy on my windows machine. The following is the nginx.conf:

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

  sendfile        on;
  keepalive_timeout  65;

  server {
      listen       *:80;
      server_name  localhost;

    
      location / {
          proxy_pass http://localhost:9000;
      }

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

When I type localhost in my browser I get the correct response.

When I use my IP-adress however it says that the website can not be reached.

I've tried allowing external access on port 80 as well as access for the nginx.exe in the Windows Defender Firewall. I also deactivated the firewall in my Kaspersky Internet Security.

Any ideas what the problem is?

IceRevenge
  • 101
  • 2
  • `server_name localhost;` means Listen for "localhost" and nothing else - either use \_default\_ meaning an invalid name to listen to any names or use like server_name localhost 192.168.1.1; – djdomi Aug 17 '21 at 12:25

1 Answers1

0

you need to enable ip access control to access it.

check this link for more steps: link and this link

uday
  • 352
  • 10
  • 30
  • First links seems like an approach but I don't want to whitelist any ip-addresses. What if I want it to be open for everyone? I tried adding only my ip-address but now calling `localhost` leads to `403 Forbidden`. Because of the second link I added `_` for `server_name` but it didn't help. – IceRevenge Aug 08 '21 at 06:43