0

I have following URL's /application/appui this runs angular app -> it has its own index.html and static files /application/api/v1/testapp1 -> proxy pass to upstream services /application/api/v1/testapp2 -> proxy pass to upstream services / -> it has its own index.html hosting swagger

    location /api/v1/testapp1 {
      //proxy pass
    }
    location /api/v1/testapp2 {
            //proxy pass
    }
    location / {
            root path;
    }
    location /application/appui {
        alias path;
        index index.html;
        try_files $uri $uri/ /application/appui/index.html;
     }
    rewrite ^/application(.*)$ $1 ;

problem here is both appui and other external api's are all prefixed with application. I want to rewrite only if url's do not have /application/appui in them. How can i achieve this ?

Tried the above nginx code and was not able to get the app ui working.

Tried with above nginx code, its not working.

  • If you want to rewrite `/application/...` but **not** `/application/appui...`, try moving the `rewrite` statement into the `location / { ... }` block. – Richard Smith Apr 12 '23 at 07:53

0 Answers0