Hi

I have this buggy backend application where I try to let Nginx sort out the
problems.

Example of required redirect:
http://ex.org/foo -> https://ex2.org/foo/    # Nx solves the bug here
http://ex.org/foo/ -> https://ex2.org/foo/
http://ex.org/foo/?id=7 -> https://ex2.org/?id=7

Here is my current configuration which is in too parts but I have the idea
that I'm doing it wrong and it can be done in only one "location" with a
regex:

    location ~ /foo$ {
        return 301 https://ex2.org$request_uri/;
    }
    location ~ /foo/$ {
        return 301 https://ex2.org$request_uri;
    }

I have several paths like /foo/ where I would like to have them all in one
regex like
  location ~ /(foo|bar)/$ {

-- 

Venlig hilsen - best regards
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx

Reply via email to