Bagisto Forum

    Bagisto

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups

    How to accurately get the user's IP address?

    General Discussion
    2
    2
    100
    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.
    • T
      tamphamdev last edited by

      I deployed my website using Docker, and I can't get the exact user IP in maintenance mode; instead, it shows Docker's local IP. Does anyone have a solution?
      https://github.com/bagisto/bagisto/blob/2.2/packages/Webkul/Core/src/Http/Middleware/CheckForMaintenanceMode.php#L75
      if (
      in_array($request->ip(), $this->excludedIPs)
      || $this->shouldPassThrough($request)
      || ! (bool) core()->getCurrentChannel()->is_maintenance_on
      ) {
      return $response;
      }

      1 Reply Last reply Reply Quote 0
      • Rishabh-Webkul
        Rishabh-Webkul last edited by

        Hello @tamphamdev

        Please check your hosted server IP. The same IP address will be added in maintenance mode.

        Thanks & Best Regards

        1 Reply Last reply Reply Quote 0
        • First post
          Last post