从 nginx url 中删除井号 (#) 并重定向

Sco*_*ter 3 nginx redirect

我想获取一个网址,添加前缀并从网址中删除井号。例如,从 http://localhost:8088/app1/#/hello 重定向到 http://localhost:8088/apps/app1/hello。

我已经尝试过这个,但它似乎不起作用:

  location /app1/ {
    rewrite ^([^#]*)([#])\/(.*) /apps$1$3 permanent;
  }
Run Code Online (Sandbox Code Playgroud)

这似乎与哈希标记有关。我可以从 http://localhost:8088/app1/q/hello 转到 http://localhost:8088/apps/app1/hello :

  location /app1/ {
    rewrite ^([^q]*)([q])\/(.*) /apps$1$3 permanent;
  }
Run Code Online (Sandbox Code Playgroud)

我需要做些什么来处理重定向中的哈希标记吗?

Ale*_*exD 10

你不能。浏览器不会#nginx. 表示仅在客户端处理的URL 片段#