Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

如何映射目录配置 证书呢? #21

Closed
Dev-Wiki opened this issue Apr 23, 2024 · 3 comments
Closed

如何映射目录配置 证书呢? #21

Dev-Wiki opened this issue Apr 23, 2024 · 3 comments

Comments

@Dev-Wiki
Copy link

客户端安装如下:

version: "3"
services:
    frps:
        restart: always
        network_mode: host
        volumes:
            - /share/Docker/frpc-base/frpc.toml:/frp/frpc.toml
        container_name: frpc-base
        image: stilleshan/frpc:0.57.0

配置如下:

[[proxies]]
name = "nas"
type = "https"
localIP = "127.0.0.1"
localPort = 5000
customDomains = ["nas.devwiki.net"]


[proxies.plugin]
type = "https2http"
localAddr = "127.0.0.1:5000"
# HTTPS 证书相关的配置
keyPath = "./nas.devwiki.net.key"
crtPath = "./nas.devwiki.net.crt"
hostHeaderRewrite = "nas.devwiki.net"
requestHeaders.set.x-from-where = "frp"
requestHeaders.set.x-forwarded-protol = "https"
requestHeaders.set.x-forwarded-port = "443"

image

运行后提示无法找到证书文件, 如何映射文件夹呢?

frpc-base | 2024-04-23 22:48:51.406 [W] [client/control.go:168] [a489dea5b830a67f] [nas] start error: gen TLS config error: open ./nas.devwiki.net.crt: no such file or directory

@Dev-Wiki
Copy link
Author

修改 目录映射:

version: "3"
services:
    frps:
        restart: always
        network_mode: host
        volumes:
            - /share/Docker/frpc-base/frpc.toml:/frp/frpc.toml
            - /share/Docker/frpc-base/ssl/:/frp/ssl/
        container_name: frpc-base
        image: stilleshan/frpc:0.57.0

能看到证书文件, 修改客户端配置:

# HTTPS 证书相关的配置
keyPath = "./ssl/nas.devwiki.net.key"
crtPath = "./ssl/nas.devwiki.net.crt"

仍然提示无法找到文件
image

2024-04-23 22:56:51.724 [W] [client/control.go:168] [2354c02ba0a4e978] [nas] start error: gen TLS config error: open ./ssl/nas.devwiki.net.crt: no such file or directory

@stilleshan
Copy link
Owner

挂载路径尽量不要重叠 /frp 目录,和配置文件错开。

比如根目录的/ssl
-v /xxx/ssl:/ssl

配置用绝对路径 /ssl
keyPath = "/ssl/nas.devwiki.net.key"

@Dev-Wiki
Copy link
Author

挂载路径尽量不要重叠 /frp 目录,和配置文件错开。

比如根目录的/ssl -v /xxx/ssl:/ssl

配置用绝对路径 /ssl keyPath = "/ssl/nas.devwiki.net.key"

重新挂了 新的目录 可以找到 正常了, 谢谢, 建议把这个写到使用说明中

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants