{"id":15801255,"url":"https://github.com/ktakashi/sagittarius-nginx","last_synced_at":"2026-04-30T01:37:12.231Z","repository":{"id":147044943,"uuid":"154514636","full_name":"ktakashi/sagittarius-nginx","owner":"ktakashi","description":"NGINX module of Sagittarius Scheme","archived":false,"fork":false,"pushed_at":"2019-06-09T20:10:02.000Z","size":145,"stargazers_count":0,"open_issues_count":1,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-10-06T01:21:47.705Z","etag":null,"topics":["nginx","sagittarius-scheme","scheme"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ktakashi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-10-24T14:21:30.000Z","updated_at":"2019-06-09T20:10:04.000Z","dependencies_parsed_at":null,"dependency_job_id":"19645b47-a637-479d-968d-109fbefb16a3","html_url":"https://github.com/ktakashi/sagittarius-nginx","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ktakashi/sagittarius-nginx","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ktakashi%2Fsagittarius-nginx","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ktakashi%2Fsagittarius-nginx/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ktakashi%2Fsagittarius-nginx/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ktakashi%2Fsagittarius-nginx/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ktakashi","download_url":"https://codeload.github.com/ktakashi/sagittarius-nginx/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ktakashi%2Fsagittarius-nginx/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32451476,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-29T22:27:22.272Z","status":"ssl_error","status_checked_at":"2026-04-29T22:10:49.234Z","response_time":110,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["nginx","sagittarius-scheme","scheme"],"created_at":"2024-10-05T01:21:32.073Z","updated_at":"2026-04-30T01:37:12.214Z","avatar_url":"https://github.com/ktakashi.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"Sagittarius module for NGINX\n============================\n\nThis repository provides Sagittarius module for NGINX. Using this,\nusers can write web application in Scheme easily.\n\nRequirements\n============\n\nThis module requires Sagittarius **0.9.6**. The later version may work\nas long as the undocumented C APIs aren't changed.\n\nHow to build\n============\n\nThe module can only be built on POSIX environment (e.g. Linux, macOS).\n\nIt provides `Makefile` to detect and build automatically so simply run\nthe following command:\n\n```shell\n$ make\n```\n\nThe module will be built in the `./build/nginx-*$version*/objs/` directory\nwith the name of `ngx_http_sagittarius_module.so`. The *$version* is currently\n**1.16.0**.\n\nIf you want to run example application, then execute the `run` target.\nThe `run` target also requires `docker`. If you don't have it, just modify\nit.\n\nNGINX config\n============\n\nThe module is built as a dynamic module, so add the following line:\n\n```\nload_module modules/ngx_http_sagittarius_module.so;\n```\n\nThe module extends the `location` directive. The following example\nadds a simple web application:\n\n```\nlocation /echo {\n  sagittarius run init clean {\n    load_path /opt/share/;\n\tlibrary \"(echo)\";\n  }\n}\n```\n\nThe `sagittarius` directive specifies that the location is handled by\nthe module. After the directive, it accepts 1 to 3 arguments; entry point,\ncontext initialisation, and clean up. The first one is mandatory and the\nrest are optional. All arguments must be exported procedures from the\nlibrary specified `library` directive, if specified.\n\nDirectives\n----------\n\n- `sagittarius` *entry* *[init]* *[cleanup]* - **required**\n\nThis directive must be inside of a location directive. It is illegal to \nput more than one `sagittarius` directive in one location directive.\n\nThe directive is a block directive, and it must have a `library` directive\ninside. \n\nThe specified location will be an entry point of the *entry* procedure which\nmust be defined in the specified library. (The library name must be specified\nby the `library` directive.) The *entry* procedure is called with 2 arguments,\nNGINX request and NGINX response, and must return 2 values, status and content\ntype.\n\nIf the optional *init* and *cleanup* are specified, then they will be called\non the very first time of the HTTP request and when the worker process is\nterminating, respectively. \n\nThe *init* and *cleanup* procedures are called with one argument, NGINX context.\n\nNOTE: The *cleanup* is only called if the *init* is called even if the worker\nprocess is terminating.\n\n- `library` *name* - **required**\n\nThe library which provides *entry* described in the `sagittarius` directive.\n\n- `load_path` *path1* *[paths ...]* - **optional**\n\nSpecifiying load path. This directive can occure multiple times.\n\n- `parameter` *name* *value* - **optional**\n\nAdding a context parameter named *name* with value of *value*. This is useful\nif users want to share the same values per context.\n\nGlossaries:\n\n- *context*: An application context. A context contains the same information\n  among the worker processes. This is equivalent with the location path.\n\nScheme APIs\n===========\n\nThe Scheme APIs provides accessor of the HTTP request, response and NGIN\ncontext.\n\nHTTP request\n------------\n\nAll the HTTP request access procedures are prefixed with `nginx-request-`.\n\n- `(nginx-request? obj)`:\n\n  Returns `#t` if the given *obj is a HTTP request otherwiese `#f`.\n\n- `(nginx-request-input-port request)`:\n\n  Returns binary input port of transfered data. This procedure **always**\n  returns an binary input port. If it's a GET request, reading a data \n  always returns EOF.\n\n- `(nginx-request-context request)`:\n\n  Returns NGINX context of this HTTP request.\n\n- `(nginx-request-method request)`:\n\n  Retunrs HTTP method of this request as a string value.\n\n- `(nginx-request-uri request)`:\n\n  Returns URI of this request.\n\n- `(nginx-request-headers request)`:\n\n  Returns alist of HTTP header name and its value.\n\n- `(nginx-request-cookies request)`:\n\n  Returns a list of HTTP cookies of `(rfc cookies)`.\n\n- `(nginx-request-query-string request)`:\n\n  Returns a query string of the HTTP request.\n\n- `(nginx-request-original-uri request)`:\n\n  Returns the original URI of the HTTP request. The returning value\n  may contain query string and fragment.\n\n- `(nginx-request-request-line request)`:\n\n  Returns the first line of the HTTP reuqest.\n\nThe followings are the convenient procedures to access HTTP headers.\nThe procedure name itself should be descriptive enough to see which\nHTTP headers are returned by the procedures.\n\n- `(nginx-request-host request)`:\n- `(nginx-request-connection request)`:\n- `(nginx-request-if-modified-since request)`:\n- `(nginx-request-if-unmodified-since request)`:\n- `(nginx-request-if-match request)`:\n- `(nginx-request-if-none-match request)`:\n- `(nginx-request-user-agent request)`:\n- `(nginx-request-referer request)`:\n- `(nginx-request-content-length request)`:\n- `(nginx-request-content-range request)`:\n- `(nginx-request-content-type request)`:\n- `(nginx-request-range request)`:\n- `(nginx-request-if-range request)`:\n- `(nginx-request-transfer-encoding request)`:\n- `(nginx-request-te request)`:\n- `(nginx-request-expect request)`:\n- `(nginx-request-upgrade request)`:\n- `(nginx-request-accept-encoding request)`:\n- `(nginx-request-via request)`:\n- `(nginx-request-authorization request)`:\n- `(nginx-request-keep-alive request)`:\n- `(nginx-request-accept request)`:\n- `(nginx-request-accept-language request)`:\n\n\nHTTP response\n-------------\n\n- `(nginx-response? obj)`:\n\n  Returns `#t` if the given *obj is a HTTP response otherwiese `#f`.\n\n- `(nginx-response-output-port response)`:\n\n  Returns binary output port of this HTTP response. This output port\n  represents the response content. Thus, writing to this port means\n  returning content to the client.\n\n- `(nginx-response-headers response)`:\n\n  Reuturns alist of HTTP headers of the response.\n  The result may or may not be freshly created.\n\n- `(nginx-response-header-add! response name value)`:\n\n  Adding an HTTP header of *name* with value *value*.\n  \n  This procedure appends the header.\n\n- `(nginx-response-header-set! response name value)`:\n\n  Setting an HTTP header of *name* with value *value*.\n  \n  This procedure replaces existing header(s).\n  \n- `(nginx-response-header-remove! response name)`:\n\n  Removes an HTTP header of *name* if exists.\n\nNGINX context\n-------------\n\n- `(nginx-context? context)`:\n\n Returns `#t` if the given *obj* is a NGINX context otherwiese `#f`.\n\n- `(nginx-context-path context)`\n\n  Returns the application context path of the given *context*.\n  \n  The value shall be the same as the path specified in `location` directive.\n  \n- `(nginx-context-parameter-ref context name)`\n\n  Returns the parameter value associated to *name* from the *context*.\n  If the parameter doesn't exist, then returns `#f`.\n\n  The parameter value is always a string.\n\n- `(nginx-context-parameters context)`:\n\n  Returns an immutable hash table which contains all parameters of the \n  *context*.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fktakashi%2Fsagittarius-nginx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fktakashi%2Fsagittarius-nginx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fktakashi%2Fsagittarius-nginx/lists"}