0
        location /checks/ {
                auth_request /auth;
                proxy_pass http://localhost:3000/meetings;
        }

        location = /auth {
          internal;
          set $query '';
          if ($request_uri ~* "[^\?]+\?(.*)$") {
              set $query $1;
          }
          proxy_pass http://localhost:9000/v1/permission/check?$query;
          proxy_pass_request_body   off;
          proxy_set_header Content-Length "";
        }

I have setup my nginx as above.

Description: I call to the url: http://my-domain.com/checks?abc=123 on browser, after passing auth_request, it will redirect to http://my-domain.com/meetings?abc=123

Error: Can not proxy_pass to http://localhost:3000/meetings. Error from nginx log: *1 localhost could not be resolved (60: Operation timed out) while sending to client, client: 127.0.0.1, server: localhost, request: "GET /checks/?abc=123

Expectations: fix the error above and proxy_pass to http://my-domain.com/meetings but do not rewrite the old URL, which means keep http://my-domain.com/checks on browser

Note: ?abc=123 just example

Please help me

Ivan Shatsky
  • 13,267
  • 2
  • 21
  • 37

0 Answers0