Skip to content

Google OAuth does not work when Gitea is configured on a sub-path via NGINX #38268

Description

@luronumen

Gitea Version

v1.26.4

What happened?

The current Nginx with a sub-path configuration is not sufficient to allow Gitea to perform authentication via Google OAuth.

Bug: Gitea is redirecting to /login/oauth/ instead of /gitea/login/oauth/

Workaround:
Added the following NGINX configuration:

        location ~ ^/login/oauth/ {
            rewrite ^/login/oauth/(.*)$ /gitea/login/oauth/$1 permanent;
        }

How are you running Gitea?

Nginx with a sub-path

Metadata

Metadata

Assignees

No one assigned

    Labels

    issue/needs-feedbackFor bugs, we need more details. For features, the feature must be described in more detail

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions