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

如何将最终接口设置成https? #81

Closed
2 tasks done
ape6239 opened this issue Oct 18, 2023 · 3 comments
Closed
2 tasks done

如何将最终接口设置成https? #81

ape6239 opened this issue Oct 18, 2023 · 3 comments
Labels
enhancement New feature or request

Comments

@ape6239
Copy link

ape6239 commented Oct 18, 2023

Checklist

  • 我相信这个想法很棒并且将使框架变得更好
  • 我已在issue中搜索了类似请求,包括已关闭的请求

详细描述

如题,部分安卓app,不允许http访问,只能用https

@ape6239 ape6239 added the enhancement New feature or request label Oct 18, 2023
@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


Title: How to set the final interface to https?

Checklist

  • I believe this idea is great and will make the framework better
  • I have searched for similar requests in the issue, including closed requests

A detailed description

As the title states, some Android apps do not allow http access and can only use https

@KenyonY
Copy link
Owner

KenyonY commented Oct 18, 2023

  1. 更建议的方式是申请一个域名,然后可以参考这里 使用nginx或caddy 和证书 将8000端口转发到https端口。

  2. 也可以参考

    ssl_keyfile = os.environ.get("ssl_keyfile", None) or None
    ssl_certfile = os.environ.get("ssl_certfile", None) or None

    直接通过环境变量传入证书文件路径,通过https访问直接访问https://ip:8000 端口(不推荐)

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


  1. The more recommended way is to apply for a domain name, and then [refer here](https://github.com/KenyonY/openai-forward/blob/main/deploy.md#%E5%BC%80%E5%90 %AFssl-%E4%BB%A5https%E8%AE%BF%E9%97%AE%E5%9F%9F%E5%90%8D) Use nginx or caddy and a certificate to forward the 8000 port to the https port.

  2. But you can also refer to

    ssl_keyfile = os.environ.get("ssl_keyfile", None) or None
    ssl_certfile = os.environ.get("ssl_certfile", None) or None

    Pass the certificate file path directly through the environment variable and allow port 8000 to be accessed through https (not recommended)

@KenyonY KenyonY closed this as completed Oct 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants