还是老老实实写正常的location吧,不搞奇淫巧计了 ![:joy: :joy:](https://cdn.linux.do/images/emoji/apple/joy.png?v=12)
我想将 frp登录面板 127.0.0.1:7001
映射成 127.0.0.1/frp/7001
这种格式,当然映射的端口不限于7001(包含frp配置中开放的端口7000:7100
),当前的配置如下:
location ~ ^/frp/(?<port>\d+)(?<path>/.*) {
set $target_port $port;
set $target_path $path;
proxy_pass http://172.17.0.1:$target_port$target_path$request_uri;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection upgrade;
proxy_set_header Accept-Encoding gzip;
}
访问 127.0.0.1:7001
后跳转登录面板 127.0.0.1:7001/static/#/
;使用上述配置后127.0.0.1/frp/7001
显示的时404如果手动加上/static/#/
url会变成127.0.0.1/static/frp/7001/static/#/
页面显示的任然是404,请问该怎么写这个nginx的规则