git - 通过SSH本地端口转发正常访问时指定gitea服务器Gitea Base URL?

标签 git reverse-proxy gitea

在我的 gitea 服务器上,我通常通过 ssh 本地端口转发访问它;它不能从外部访问,因为我将它绑定(bind)到本地主机地址。

我从 http://127.0.0.1:8080 访问它通过“本地端口转发”,它认为它是从 http://127.0.0.1:3000 访问的;所以某些功能(wiki 中的预览和例如问题不起作用(但是你可以保存它们,只是不预览它们);无论如何它配置错误,见下文,我想更改 Gitea Base URL 所以当服务器当前写入 http://127.0.0.1:3000 时,它会改为写入 http://127.0.0.1:8080 (不过话说回来,如果它仍然在端口 3000 之外运行就更好了):

gitea configuration
gitea.ini在哪一行更改此功能?还是更像是我需要在它前面放置一个反向代理来为我重写 URL 的情况?

最佳答案

我没有纠结端口号,而是想更改域(localhost 到 foo)并找到 ROOT_URLconfig cheat sheet 中提到:

ROOT_URL: %(PROTOCOL)s://%(DOMAIN)s:%(HTTP_PORT)s/: Overwrite the automatically generated public URL. This is useful if the internal and the external URL don’t match (e.g. in Docker).


还有一个 HTTP_PORT 选项也适用于您。
查看您的 /path/to/gitea/conf/app.ini -> [server]部分并相应更改
[server]
  APP_DATA_PATH    = /path/to/gitea
  DOMAIN           = localhost
  SSH_DOMAIN       = localhost
  HTTP_PORT        = 3000
  ROOT_URL         = http://localhost:3000/

I'd like to change the Gitea Base URL so that anytime the server currently writes http://127.0.0.1:3000 it will write http://127.0.0.1:8080 instead (but that said, it would be good if it still operated off of port 3000):


我假设将 ROOT_URL 设置为 http://127.0.0.1:8080但将 HTTP_PORT 保留为默认值 3000应该这样做。

关于git - 通过SSH本地端口转发正常访问时指定gitea服务器Gitea Base URL?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61647469/

相关文章:

windows - 为什么我的 Windows 机器上的 git 很慢?

Docker容器停止后不会再次启动

SVN Changelist 的 Git 等效项?

git - 切换 Git 子树分支的正确方法?

docker - 使用 Docker 的 Traefik 反向代理

用于重定向域的 NGinx 配置

redirect - 拦截后端 301/302 重定向 (proxy_pass) 并可能重写到另一个位置 block ?

mysql - MariaDB 命令不同步

windows - 为什么gitea添加了ssh还需要密码登录?

Git:在整个 git 历史记录中显示对指定文件中单行的所有各种更改