Skip to content

nkottary/ngx-http-julia-module

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Julia language extension for Nginx

Use the julia language from inside nginx config. You can place code snippets that can also include() julia files. You can receive HTTP header and body data from requests and also send HTTP responses from julia.

Goals:

  • julia header filter
  • julia body filter
  • content_by_julia directive
  • julia proxy directive

This is inpired by and very similar to OpenResty which implements a Lua language extension to nginx among other things.

How to build:

  1. Download nginx source code from github or from the nginx website download page. I am using nginx-1.21.3.
wget https://nginx.org/download/nginx-1.21.3.tar.gz
  1. Extract the downloaded nginx source code archive. Clone this repo into the modules directory.
tar -xzf nginx-1.21.3.tar.gz
cd nginx-1.21.3/modules
git clone https://github.com/nkottary/ngx-http-julia-module
  1. Install libjson dependency:

Ubuntu:

sudo apt install libjson-dev
  1. Open the config file and modify the JULIA_DIR variable to point to the julia binary directory on your computer. For example, I use julia 1.11.2, my julia binary directory is ~/.julia/juliaup/julia-1.11.2+0.x64.linux.gnu.

  2. Configure nginx build environment. Run configure with the --add-module option:

./configure --add-module=modules/ngx_http_julia_module
  1. Build the nginx binary. We will build our module into nginx. There are ways to build the Julia module separately and link the binary to nginx, but that is yet to be explored. Navigate to the nginx-1.21.3 directory and run:
configure
make

References:

The following guides helped me learn about nginx module development:

About

julia language extension for nginx

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages