Public link shows blank page and 404 when I hide it behind nginx proxy

Hi there, I wonder if anyone have similar challenge as below.

I would like to hide the url string of the public link as it contains the path to the metabase login page.
But when I configure proxy on my Nginx as below, it shows blank page and 404 error on the access log.

location /mblogin/ {
  proxy_pass http://127.0.0.1:3000/; # this works
}

location /public1/ {
  proxy_pass https://metabase.[mydomain]/mblogin/public/dashboard/061ca8e1-8da8-4a31-9ae0-ae70d74cccf7/; # this doesn't work. 
}

Kindly advise if there is a practice to hide the public link behind the proxy of nginx.
Please advise if I had better to share any other configuration information or logs.

Thank you,

Here is the accesslog

211.24.79.252 - - [09/Sep/2021:18:47:38 +0800] "GET /api/session/properties HTTP/2.0" 404 3696 "https://metabase.[mydomain]/public1/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.4577.63 Safari/537.36" "-"
211.24.79.252 - - [09/Sep/2021:18:47:38 +0800] "GET /app/dist/1e07783e66572fcf1816d1195b38188b.svg HTTP/2.0" 404 3696 "https://metabase.[mydomain]/app/dist/styles.bundle.css?3db78acfe2a5663576603dce678cd7bb" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.4577.63 Safari/537.36" "-"
211.24.79.252 - - [09/Sep/2021:18:47:38 +0800] "GET /app/dist/1efbd38aa76ddae2580fedf378276333.woff2 HTTP/2.0" 404 3696 "https://metabase.[mydomain]/app/dist/styles.bundle.css?3db78acfe2a5663576603dce678cd7bb" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.4577.63 Safari/537.36" "-"

Hi @sotaro27
What is your Site URL configured to? Make sure it matches how people are accessing Metabase.
You would have to create rewrites for all the assets too.
I don't understand what the problem is by showing the location of the login.

Dear @flamber

Thank you for your reply. Yes, I have configured my site URL as https://metabase.[mydomain]/mblogin, which is the same URL as I configured it in the location path. Let me extend the nginx configuration until server_name part.

server {
    listen       443 ssl http2 default_server;
    listen       [::]:443 ssl http2 default_server;
    server_name  metabase.[mydomain];
    root         /usr/share/nginx/html;

    ssl_certificate "/etc/pki/nginx/[mydomain]_chain.crt";
    ssl_certificate_key "/etc/pki/nginx/private/[mydomain].key";

    location /mblogin/ {
        proxy_pass http://127.0.0.1:3000/;
    }

    location /public1/ {
        proxy_pass https://metabase.[mydomain]/mblogin/public/dashboard/061ca8e1-8da8-4a31-9ae0-ae70d74cccf7/;
    }

Here is a comparison between the access from the URL generated by metabase VS the access through proxy URL.

From the normal URL <200>
211.24.79.252 - - [09/Sep/2021:19:44:11 +0800] "GET /mblogin/app/dist/b4d2c4c39853ee244272c04999b230ba.woff2 HTTP/2.0" 200 23489 "https://metabase.[mydomain]/mblogin/app/dist/styles.bundle.css?3db78acfe2a5663576603dce678cd7bb" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.4577.63 Safari/537.36" "-"

From the proxy URL  <404>
211.24.79.252 - - [09/Sep/2021:18:47:38 +0800] "GET /app/dist/1e07783e66572fcf1816d1195b38188b.svg HTTP/2.0" 404 3696 "https://metabase.[mydomain]/app/dist/styles.bundle.css?3db78acfe2a5663576603dce678cd7bb" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.4577.63 Safari/537.36" "-"

@sotaro27
Please explain what the point is of hiding the address.
You would need to either create rewrites for the 404 paths or use substitute to change the URLs.
Metabase does not officially support running in non-root, so there are some issues around that.

Dear @flamber

Thank you so much for your feedback. Then, let me try some various workaround to realize this.

Regards,