# settings put global captive_portal_use_https 0
# settings put global captive_portal_http_url "http://connectivitycheck.sp-codes.de/generate204"If you want to use
# settings put global captive_portal_use_https 1
# settings put global captive_portal_https_url "https://connectivitycheck.sp-codes.de/generate204"
Maybe you have to reboot your phone after updating the settings. For more information see this.
If you are using AFWall+ you need to give access to  Android-System and in some cases  CaptivePortalLogin to make it work.
# sudo nano /etc/NetworkManager/NetworkManager.confAdd the following lines (or change them to this):
[connectivity] uri=https://connectivitycheck.sp-codes.de/generate204Restart the network-manager:
# sudo service network-manager restart
For more information see this.