Uploaded image for project: 'Mender'
  1. Mender
  2. MEN-2174

Api Gateway nginx 301 location redirects fail with port change

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Done
    • Priority: (None)
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.7.0
    • Labels:

      Description

      If you cannot run demo or production mender backend api-gateway on port 443 then its easy to change in the yaml file. However in the api-gateway nginx.conf there are a couple of location permanent redirects (301) that use relative paths which do not account for a port change. This results in not being able to load the api-gateway pages in a browser or curl as the supplied redirect location in the http response is incorrect as it doesn't contain the port. 

      Changing the redirect path to contain the host info resolves the situation.

      /usr/local/openresty/nginx/conf/nginx.conf

       

      The current entries that fail are as follows:

      location = /ui {
      return 301 /ui/;
      }

      location = / {
      return 301 /ui/;
      }

      The suggested fix is as follows:

       
      location = /ui {
      return 301 https://$http_host/ui/;
      }

      location = / {
      return 301 https://$http_host/ui/;
      }

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                a10003 Eystein Maloy Stenberg
                Reporter:
                dell.green@ideaworks.co.uk Dell Green
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Summary Panel