Example of nginx plugin written in Golang and loaded by nginx-link-function
Add nginx-link-function https://github.com/Taymindis/nginx-link-function module to your nginx.
go build -o main.so -buildmode=c-shared .
# nginx.conf
server {
listen 8989;
aio threads;
...
ngx_link_func_lib "/path/to/your-plugin/main.so"; # sharing data memory with server 1 if the path are same with server 1
...
...
location = /test {
ngx_link_func_call "return_custom_http_headers_and_response"
}
}