lighttpd reverse proxy not working #2577

Closed
opened 2025-11-02 04:41:00 -06:00 by GiteaMirror · 3 comments
Owner

Originally created by @SuNNjek on GitHub (Nov 26, 2018).

  • Gitea version (or commit ref): 1.6.0
  • Git version: 2.11.0
  • Operating system: Raspbian 9
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • Not relevant
  • Log gist:

Description

I'm trying to set up Gitea with lighttpd as a reverse proxy. Because I also have another site on my domain, I want to run at a subpath like so: https://(domain)/git/. For now I've used the settings from the Gogs FAQ, but I'm running into a few errors:

  • When I log in I get redirected to https://(domain)/git/git throwing a 404
  • When I try to create a repository, I get the error "Invalid csrf token.". In the cookie setting the CSRF token is the wrong path again.

I'm running lighttpd 1.4.50.
Is there any difference between setting up lighttpd with Gogs as opposed to Gitea? I've noticed it's missing in Gitea's FAQ as well.

Screenshots

gitea2

gitea1

Originally created by @SuNNjek on GitHub (Nov 26, 2018). <!-- 1. Please speak English, this is the language all of us can speak and write. 2. Please ask questions or configuration/deploy problems on our Discord server (https://discord.gg/NsatcWJ) or forum (https://discourse.gitea.io). 3. Please take a moment to check that your issue doesn't already exist. 4. Please give all relevant information below for bug reports, because incomplete details will be handled as an invalid report. --> - Gitea version (or commit ref): 1.6.0 - Git version: 2.11.0 - Operating system: Raspbian 9 - Database (use `[x]`): - [x] PostgreSQL - [ ] MySQL - [ ] MSSQL - [ ] SQLite - Can you reproduce the bug at https://try.gitea.io: - [ ] Yes (provide example URL) - [ ] No - [x] Not relevant - Log gist: ## Description I'm trying to set up Gitea with lighttpd as a reverse proxy. Because I also have another site on my domain, I want to run at a subpath like so: https://(domain)/git/. For now I've used the settings from the [Gogs FAQ](https://gogs.io/docs/intro/faqs#how-do-i-set-up-a-sub-url-with-lighttpd%3F), but I'm running into a few errors: - When I log in I get redirected to https://(domain)/git/git throwing a 404 - When I try to create a repository, I get the error "Invalid csrf token.". In the cookie setting the CSRF token is the wrong path again. I'm running lighttpd 1.4.50. Is there any difference between setting up lighttpd with Gogs as opposed to Gitea? I've noticed it's missing in Gitea's FAQ as well. ## Screenshots <!-- **If this issue involves the Web Interface, please include a screenshot** --> ![gitea2](https://user-images.githubusercontent.com/20151081/49042965-e9eacd80-f1c9-11e8-8d39-04a220ef53b2.png) ![gitea1](https://user-images.githubusercontent.com/20151081/49043112-641b5200-f1ca-11e8-8467-c3e577b59fe5.png)
Author
Owner

@lafriks commented on GitHub (Nov 27, 2018):

It should be same as in gogs. Just check that you have correct urls in app.ini

@lafriks commented on GitHub (Nov 27, 2018): It should be same as in gogs. Just check that you have correct urls in app.ini
Author
Owner

@SuNNjek commented on GitHub (Nov 27, 2018):

I do have my ROOT_URL set to https://(domain)/git/
I have also copied the example from the Gogs FAQ almost verbatim (except for exchanging the path of course).
I also tried removing the trailing slash but that just breaks it more.

@SuNNjek commented on GitHub (Nov 27, 2018): I do have my ROOT_URL set to https://(domain)/git/ I have also copied the example from the Gogs FAQ almost verbatim (except for exchanging the path of course). I also tried removing the trailing slash but that just breaks it more.
Author
Owner

@SuNNjek commented on GitHub (Nov 27, 2018):

After trying various things I've decided to abandon this approach and have Gitea running on a subdomain instead. I'm going to close this issue now

@SuNNjek commented on GitHub (Nov 27, 2018): After trying various things I've decided to abandon this approach and have Gitea running on a subdomain instead. I'm going to close this issue now
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#2577