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

400 BadRequestHeaderException Invalid token #133

Open
clearshot-xs opened this issue Jan 4, 2023 · 0 comments
Open

400 BadRequestHeaderException Invalid token #133

clearshot-xs opened this issue Jan 4, 2023 · 0 comments

Comments

@clearshot-xs
Copy link

Hi,

I'm trying to setup Lychee Docker through nginx reverse proxy but keep receiving a "400 BadRequestHeaderException Invalid token" error. Lychee seems to work fine if accessed through the local IP, but when exposed through nginx it stops working.

image

nginx config

location /lychee/ {
  proxy_pass http://127.0.0.1:90/;
  proxy_set_header Host $host;
  proxy_set_header X-Real-IP $remote_addr;
  proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  proxy_set_header X-Forwarded-Host $host;
  proxy_set_header X-Forwarded-Proto $scheme;
}

I have also set APP_URL and TRUSTED_PROXIES on the docker container to the following but its still not working.

APP_URL=https://my.domain/lychee/
TRUSTED_PROXIES=*

The issue seems to be related to the CSRF token cookie not being set properly when proxied through nginx.

Any help to point me in the right direction would be appreciated.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant