Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
gabevenberg opened this issue May 20, 2021 · 3 comments
Closed
Labels
type/docs This PR mainly updates/creates documentation

Comments

@gabevenberg
Copy link

gabevenberg commented May 20, 2021

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.

@gabevenberg gabevenberg changed the title 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): nginx reverse proxy with subpath documentation not valid nginx syntax May 20, 2021
@noerw noerw added the type/docs This PR mainly updates/creates documentation label May 20, 2021
noerw added a commit to noerw/gitea that referenced this issue Jul 10, 2021
@stale
Copy link

stale bot commented Jul 21, 2021

This issue has been automatically marked as stale because it has not had recent activity. I am here to help clear issues left open even if solved or waiting for more insight. This issue will be closed if no further activity occurs during the next 2 weeks. If the issue is still valid just add a comment to keep it alive. Thank you for your contributions.

@stale stale bot added the issue/stale label Jul 21, 2021
@pat-s
Copy link
Member

pat-s commented Jul 21, 2021

The docs as of today already have this trailing slash added.
Did not check when it was added.

@stale stale bot removed the issue/stale label Jul 21, 2021
@zeripath
Copy link
Contributor

sounds like this fixed then.

@go-gitea go-gitea locked and limited conversation to collaborators Oct 19, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type/docs This PR mainly updates/creates documentation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants