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

Update Caddy2 reverse proxy configuration #85

Open
ysmintor opened this issue Jun 29, 2023 · 1 comment
Open

Update Caddy2 reverse proxy configuration #85

ysmintor opened this issue Jun 29, 2023 · 1 comment

Comments

@ysmintor
Copy link

ysmintor commented Jun 29, 2023

Hi,
Recently, I changed to use caddy2. But the configuration is not working as you mentioned. So I searched from caddy2 official websites and ask from ChatGPT, I finally got the right one. You need to remove the v1 path.

Also, I will give a named match example blow. You can think api is equal v1 in your example. Then you can put url https://yourdomain.example.com/api in OpanAi endpoint. The import things is to delete path in reverse proxy. You might have a try to use handle_path to do the same things.

        route /api* {
            uri strip_prefix /api
            reverse_proxy https://api.openai.com  {
                header_up Host api.openai.com
                header_up Authorization "{http.request.header.Authorization}"
            }
        }
@xqdoo00o
Copy link
Owner

xqdoo00o commented Jul 5, 2023

Caddy新版本出来后,我再试试

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