Hi Guys,
Your reply helped me as well. Thank you. I'm still struggling with the issue of rewriting /admin when using subpath.
When I click login icon I'm redirected with 302 to $host/admin not $host/fa/admin
This happened after I updated my FA.
location /fa/ {
proxy_http_version 1.1;
proxy_set_header X-Forwarded-Proto https;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Accept-Encoding "";
sub_filter 'action="/' 'action="/fa/';
sub_filter 'href="/' 'href="/fa/';
sub_filter 'href="/admin/' 'href="/fa/admin/';
sub_filter 'src="/images' 'src="/fa/images';
sub_filter 'src="/js' 'src="/fa/js';
sub_filter_once off;
proxy_pass http://localhost:9011/;
}
location ~^/(?<fusionPath>(oauth2|admin|ajax|login|password|js/identityProvider))/ {
proxy_pass http://127.0.0.1:9011/$fusionPath/;
# https://fusionauth.io/docs/v1/tech/admin-guide/proxy-setup#how-to-use-a-proxy
proxy_set_header X-Forwarded-Proto https;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Accept-Encoding "";
sub_filter 'action="/' 'action="/fa/';
sub_filter 'href="/' 'href="/fa/';
sub_filter 'src="/images' 'src="/fa/images';
sub_filter 'src="/admin' 'src="/fa/admin';
sub_filter 'src="/js' 'src="/fa/js';
sub_filter_once off;
}