mirror of
https://github.com/tufanbarisyildirim/gonginx.git
synced 2026-04-27 00:35:51 +03:00
[GH-ISSUE #44] unknown directive 'application/octet-stream' #19
Labels
No labels
bug
enhancement
good first issue
pull-request
question
v2
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/gonginx#19
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @ghost on GitHub (Mar 23, 2024).
Original GitHub issue: https://github.com/tufanbarisyildirim/gonginx/issues/44
Hello,
When I add this into the nginx configuration in server block, the parser gives me unknown directive error:
exact error message: unknown directive 'application/octet-stream' on line 10, column 9
Is there anyway to skip this or even better make it parse this?
Thank you in advance.
@ghost commented on GitHub (Mar 23, 2024):
As a workaround I did put them in a file and included them in the config.
@mofantor commented on GitHub (Mar 31, 2024):
You can use parser.WithSkipValidDirectivesErr to skip syntax checks, as in the following code snippet: parser.NewParser(filePath, parser.WithSkipValidDirectivesErr())
@ghost commented on GitHub (Apr 1, 2024):
Shouldn't these be parsed? I mean I got issues with this and using variables in server blocks, I eventually switched to crossplane and parsed the whole nginx file then got my needed directive arguments but this would be very better as crossplane parsed whole nginx file instead of individual files.
@tufanbarisyildirim commented on GitHub (Feb 20, 2026):
Re-checked on current
masterand this appears resolved.I reproduced your exact case:
server { types { application/octet-stream mp4; ... } }Parsing succeeds and dump output preserves those entries. I also verified the same inside
http -> server -> types.Closing as fixed in current code. If you still hit this on latest code, please reopen with a minimal config and the exact library version/commit.