1
1
1exx2017-03-16 18:27:23
Nginx
1exx, 2017-03-16 18:27:23

Nginx as a reverse proxy in a subdirectory?

I want something strange, namely: to organize centralized access to the zoo from servers with web applications and make access like: example.com/webapp1, example.com/webapp2.
It seemed that Nginx would perfectly cope with the Wishlist, but no, there was a nuance: most of the applications work fine only if you hang them on the root location.
Digging in mana and Google suggested a few ideas, but a fully working version did not work out.
Comparatively working version:

set $webapp1 "http://10.10.1.13";
        location ~* /app1/(?<app>.*) {
            proxy_pass $webapp1/$app;
            proxy_redirect $webapp1/ /app/;
        }

But in some cases, applications redirect beyond their location (for example, a 302 redirect to the root). This can be fenced with crutches from locations and sub_filter, but this does not guarantee the full performance of the application.
Is it possible to solve this problem only with nginx?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question