Crissium/SilverDict

nginx won't proxy certain API requests?

Closed this issue · 1 comments

It's not a problem with SilverDict, I guess, but my nginx configs instead. If I try to run

curl https://www.eplscz1rvblma3qpwsxvrpo930wah.xyz/api/cache/GrandRobert/GrandRobert.css

on my local machine, I get a 404 error. But if I curl the CSS directly using the backend API on the server, it is all right:

curl localhost:2628/api/cache/GrandRobert/GrandRobert.css -o-
��.m1 {text-align: justify}
.m2 {text-align: justify;padding-left: 4%}
.m3 {text-align: justify;padding-left: 8%}
.m4 {text-align: justify;padding-left: 12%}
.m6 {color: gray}
.m8 {text-align: center;padding-right: 20%}

Additionally, if I look up some words on my local machine using the remote API, it also works well:

curl -I https://www.eplscz1rvblma3qpwsxvrpo930wah.xyz/api/lookup/GrandRobert/polonais
HTTP/2 200 
date: Thu, 18 May 2023 11:46:07 GMT
content-type: text/html; charset=utf-8
access-control-allow-origin: *
x-frame-options: DENY
x-xss-protection: 1; mode=block
x-content-type-options: nosniff
strict-transport-security: max-age=31536000
cf-cache-status: DYNAMIC
report-to: {"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=56dTOUG9%2FBS2Xh1OdRwi9lDgmgWxEwncSb41GC9KIWjNlEy0TiRPummyfqDitR0Zd1APn3r%2FN7eRZYqGYNpbqf%2BgCoisDGIb%2BQ%2FeJA8axju90SKIn9iWuzfahkj5ZmHYwP88969BQ3PnYN%2FrilkMPneU6iLJEde%2FD48tErzjnry%2Fdnmj"}],"group":"cf-nel","max_age":604800}
nel: {"success_fraction":0,"report_to":"cf-nel","max_age":604800}
server: cloudflare
cf-ray: 7c93db9aad6804f7-HKG
alt-svc: h3=":443"; ma=86400, h3-29=":443"; ma=86400

So, it seems that nginx just won't proxy requests under /api/cache/. What could be the problem?


Moreover, my local nginx (on my laptop) does proxy such requests:

curl localhost:80/api/cache/GrandRobert/GrandRobert.css -o-
��.m1 {text-align: justify}
.m2 {text-align: justify;padding-left: 4%}
.m3 {text-align: justify;padding-left: 8%}
.m4 {text-align: justify;padding-left: 12%}
.m6 {color: gray}
.m8 {text-align: center;padding-right: 20%}

Well the problem just disappears with my new demo and the configuration is not changed.