Skip to content

nginx reverse proxy with subpath documentation not valid nginx syntax #15931

Closed
@gabevenberg

Description

@gabevenberg

This is what works for me for http://domain.com/git/ (running nginx/1.16.1 and Gitea version 1.8.3+2-g11f6ed4f8 built with go1.12.6 : bindata, sqlite, sqlite_unlock_notify):

server {
    listen 80;
    server_name domain.com ;

location /git/ {
    proxy_pass http://localhost:3000/;
    }
}

Without the trailing slash on proxy_pass everything was 404.

Originally posted by @defulmere in #8635 (comment)

when using the above in an nginx config, nginx gives me the following error:
nginx: [emerg] "proxy_pass" cannot have URI part in location given by regular expression, or inside named location, or inside "if" statement, or inside "limit_except" block in /etc/nginx/locations/venberg.xyz_sites/gitea:2
using @donpdonp 's inital solution worked perfectly.

only issue now is that mydomain.xyz/git/ works, but mydomain.xyz/git (without trailing space) gives a 404 error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    type/docsThis PR mainly updates/creates documentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions