:neocat_googly_woozy: am i missing something? running iocaine with nginx reverse proxy using the proxy_intercept_errors with error_page 421 @fallback where the location @fallback contains the actual proxy_pass stuff to the service itself. it does work like that, but my gripes with it is that the http status code is 421 instead of the ones returned by the upstream service
just the condensed location blockslocation / {
proxy_cache off;
proxy_intercept_errors on;
proxy_set_header Host $http_host;
# passing to iocaine
proxy_pass http://iocaine-upstream;
error_page 421 @fallback;
}
location @fallback {
# all proxy header stuff for the upstream service
proxy_set_header Host $http_host;
proxy_pass http://service-upstream;
}
and yes, the server block does have recursive_error_pages enabled
does anyone have managed to get it return the correct status codes? can't find anything related to it in their issue tracker or docs, so i'm a bit lost here. search doesn't show anything meaningful either
(and please don't tell me to "use some other web server", go do your missionary work somewhere else, thanks)
boosts appriciated :boost_ok:
#askfedi #iocaine #fedihelp
Conversation
Notices
-
Embed this notice
Puniko ? (puniko@mk.absturztau.be)'s status on Tuesday, 27-Jan-2026 19:09:41 JST
Puniko ?
-
Embed this notice
Puniko ? (puniko@mk.absturztau.be)'s status on Tuesday, 27-Jan-2026 19:17:54 JST
Puniko ?
@mstar i just want it to return the http status codes from http://service-upstream; instead of the already set 421 by iocaine.
-
Embed this notice
mstar@mk.absturztau.be's status on Tuesday, 27-Jan-2026 19:18:01 JST
mstar
@puniko Could this maybe help? https://serverfault.com/a/722644
-
Embed this notice
Puniko ? (puniko@mk.absturztau.be)'s status on Tuesday, 27-Jan-2026 19:25:57 JST
Puniko ?
@mstar idk how i should use it here even since it needs a uri parameter (thats not an optional parameter by the looks of it), which doesn't make sense to pass for example for a http 200
-
Embed this notice
mstar@mk.absturztau.be's status on Tuesday, 27-Jan-2026 19:26:05 JST
mstar
@puniko yea, the answer I've linked was the closest I could find so far
-
Embed this notice
Puniko ? (puniko@mk.absturztau.be)'s status on Tuesday, 27-Jan-2026 19:30:28 JST
Puniko ?
@mstar actually, it helped, me idiot forgot to set the equal sign in the first error_page directive, now it works
-
Embed this notice
Puniko ? (puniko@mk.absturztau.be)'s status on Tuesday, 27-Jan-2026 19:32:55 JST
Puniko ?
@calv@raru.re iocaine works by returning a 421 if the requesting party passed the anti-ai-bot checks. proxy_intercept_errors is used here for nginx to be able to act on the returned error code from iocaine upstream and error_page redirects it to the actual upstream service.
issue was that i forgot to set an equal sign at the error_code directive to tell nginx to override the error code with the one returned from the mock error page @fallback -
Embed this notice
calv (calv@raru.re)'s status on Tuesday, 27-Jan-2026 19:33:03 JST
calv
@puniko note: i don't used iocaine, but could it be the
`proxy_intercept_errors on;` overriding the codes? I dunno if it breaks other settings though.(also sorry if the formatting is jank i dunno if mastodon supports code blocks, and if so how to get them to work lol)
-
Embed this notice