Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    [solved] Captive Portal and nginx

    Scheduled Pinned Locked Moved 2.3-RC Snapshot Feedback and Issues - ARCHIVED
    5 Posts 2 Posters 2.6k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • B
      Bilhega
      last edited by

      Hi all.

      After upgrade to beta, the captive portal service doesn´t get running due this error :

      /status_services.php: The command '/usr/local/sbin/nginx -c /var/etc/nginx-portalwifigratuito-CaptivePortal.conf' returned exit code '1', the output was 'nginx: [emerg] invalid condition "$http_host" in /var/etc/nginx-portalwifigratuito-CaptivePortal.conf:34'

      and the section of the file  /var/etc/nginx-portalwifigratuito-CaptivePortal.conf:

      server {
                      listen 8002;
                      listen [::]:8002;
                      limit_conn addr 10;

      if ($http_host = 192.168.77.1) {
                              set $cp_redirect no;
                      }
                      if ($http_host = ) {                            <<–- line 34
                              set $cp_redirect no;
                      }

      I guess there is something wrong in the function "system_generate_nginx_config" that generates this config file.

      regards,
        JC Bilhega

      JC Bilhega

      1 Reply Last reply Reply Quote 0
      • rbgargaR
        rbgarga Developer Netgate Administrator
        last edited by

        Can you share <captiveportal>block of your config.xml?</captiveportal>

        Renato Botelho

        1 Reply Last reply Reply Quote 0
        • rbgargaR
          rbgarga Developer Netgate Administrator
          last edited by

          I pushed a fix to prevent it to happen

          Renato Botelho

          1 Reply Last reply Reply Quote 0
          • B
            Bilhega
            last edited by

            Thanks Renato!!! I´ll try it asap. If you still need the <captiveportal>block, let me know.</captiveportal>

            JC Bilhega

            1 Reply Last reply Reply Quote 0
            • B
              Bilhega
              last edited by

              Fixed. Thanks again.

              JC Bilhega

              1 Reply Last reply Reply Quote 0
              • First post
                Last post
              Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.