I'm using nginx to redirect all traffic to login.com (local server). And I want the sign into this wifi network message to appear. I searched for a long time and found out that android does a request to clients3.google.com/generate_204. If it redirects or returns something else than status code 204 is SHOULD display the login to wifi network message.

But with mine. It doesn't work. Here is my nginx config:

server {
        listen 80 default_server;
        listen [::]:80 default_server;

        location / {
                return 302 http://login.com;

When I connect to my wifi network and go to a random website I get redirected to login.com. That works. If I go to a random-website.com/generate_204 it also gets redirected. And yes if I go to clients3.google.com/generate_204 it also gets redirected. But NO 'Sign into wifi network notification' appears.

I also tried not to redirect /generate_204 but instead use alias to display the login.com content but it didn't work.

From https://www.chromium.org/chromium-os/chromiumos-design-docs/network-portal-detection

If for any reason the web page is not returned, or an HTTP response other than 204 is received, then shill marks the service as being in the portal state.

I tried this but it didn't work. (also tried to return code 500 etc.)

What am I doing wrong? It should work because I saw it before.

  • Via e.g. adb shell, try settings get global captive_portal_mode. If that's set to something else than 1, you've got your culprit. See: Captive Portal parameters – Izzy Nov 27 '17 at 17:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.