添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接

Running web applications from the subdirectory of a URL has its benefits. There doesn’t seem to be much talk about this A series of posts about running my favorite open source applications from a URL subdirectory sounds like a good idea. It’s useful when you need to expose a web application quickly without provisioning a new subdomain and SSL certificate.

For example let’s run Gitea from the subdirectory of a domain using nginx We will make Gitea accessible from a URL of the form https://www.example.com/gitea or https://www.example.com/git .

To accomplish this, reverse proxy using a separate location block in the nginx We are connecting over a unix socket to access the Gitea instance. The forward slashes at the end of the proxy_pass are important and match the location block. proxy_pass http://unix:/opt/gitea/var/lib/gitea/gitea.socket:/ ;

Then in Gitea’s app.ini configuration, adjust the server block to match the location block specified Be sure that broad caching and deny directives are not applied to the reverse proxy location block or you might end up with strange 404s and exotic behavior. SSH_DOMAIN = example.com DOMAIN = http://www.example.com/gitea/ ROOT_URL = http://www.example.com/gitea/ HTTP_ADDR = /opt/gitea/var/lib/gitea/gitea.socket future versions of Gitea , the unix protocol value is deprecated in favour of http+unix .

[server]
PROTOCOL         = http+unix
SSH_DOMAIN       = example.com
DOMAIN           = http://www.example.com/gitea/
ROOT_URL         = http://www.example.com/gitea/
HTTP_ADDR        = /opt/gitea/var/lib/gitea/gitea.socket

A user can access the full Gitea instance from the gitea/ subdirectory of the URL .

All applications are not created equal and some blow up badly in a subdirectory. Gitea supports this natively from the configuration.

Some applications require elaborate tricks, workarounds, or source code changes that are probably not worth the effort.

  • https://thedroneely.com/posts/
  • https://thedroneely.com/projects/
  • https://thedroneely.com/about/
  • https://thedroneely.com/contact/
  • https://thedroneely.com/abstracts/
  • https://ko-fi.com/thedroneely
  • https://thedroneely.com/tags/git/
  • https://thedroneely.com/tags/nginx/
  • https://thedroneely.com/posts/gitea-in-a-sub-directory-with-nginx/#isso-thread
  • https://thedroneely.com/posts/rss.xml
  • https://thedroneely.com/images/gitea-in-a-sub-directory-with-nginx.png
  • https://gitea.io/en-us/
  • http://nginx.org/en/docs/
  • https://thedroneely.com/posts/gitea-in-a-sub-directory-with-nginx/#code-block-608218e
  • https://www.digitalocean.com/community/tools/nginx
  • https://thedroneely.com/posts/gitea-in-a-sub-directory-with-nginx/#code-block-7f9b3d3
  • https://github.com/go-gitea/gitea/commit/f49d160447899270fbca6370cb7ab2742dce85dc
  • https://thedroneely.com/posts/gitea-in-a-sub-directory-with-nginx/#code-block-bd11a01
  • https://www.thedroneely.com/posts/gitea-in-a-sub-directory-with-nginx.md
  • https://thedroneely.com/archives/projects/
  • https://thedroneely.com/posts/kubernetes-in-a-linux-container/
  • https://thedroneely.com/projects/voiceover-website/
  • https://git.sr.ht/~sircmpwn/openring
  • https://drewdevault.com/2022/11/12/In-praise-of-Plan-9.html
  • https://drewdevault.com/
  • https://mxb.dev/blog/the-indieweb-for-everyone/
  • https://mxb.dev/
  • https://www.taniarascia.com/simplifying-drag-and-drop/
  • https://www.taniarascia.com/
  • https://thedroneely.com/posts/gitea-in-a-sub-directory-with-nginx#isso-thread
  • https://thedroneely.com/posts/gitea-in-a-sub-directory-with-nginx#code-block-608218e
  • https://thedroneely.com/posts/gitea-in-a-sub-directory-with-nginx#code-block-7f9b3d3
  • https://thedroneely.com/posts/gitea-in-a-sub-directory-with-nginx#code-block-bd11a01
  • https://thedroneely.com/posts/good-evil-and-the-law/
  • https://thedroneely.com/abstracts/golden-sun/
  • https://thedroneely.com/posts/writing-with-vale/
  • https://thedroneely.com/posts/making-web-pages/
  • https://thedroneely.com/posts/keeping-up-with-open-source/
  • https://drewdevault.com/2022/09/16/Open-source-matters.html
  • https://mxb.dev/blog/make-free-stuff/
  • https://thedroneely.com/sitemap.xml
  • https://thedroneely.com/index.json
  • https://thedroneely.com/resume/
  • https://gitlab.com/tdro
  • https://github.com/tdro
  • https://codeberg.org/tdro
  • https://thedroneely.com/analytics
  • https://thedroneely.com/posts/gitea-in-a-sub-directory-with-nginx#
  • https://creativecommons.org/licenses/by-sa/2.0/
  • https://thedroneely.com/git/thedroneely/thedroneely.com
  • https://opensource.org/licenses/GPL-3.0
  • https://www.thedroneely.com/
  • https://thedroneely.com/posts/gitea-in-a-sub-directory-with-nginx/#
  •