Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

84 lines (65 sloc) 1.707 kb
worker_processes 1;
debug_points abort;
pid /tmp/nginx-js.pid;
error_log logs/error.log debug_http;
events { worker_connections 1024; }
http
{
include /usr/local/nginx/conf/mime.types;
default_type text/html;
js_maxmem 4M;
# js_utf8; # do not know why but it's broken
js_load 'js/nginx.js';
js_require 'Handler.js';
# js_set Nginx.someVar 123;
# js_filter 'Handler.processFilter';
# js_filter_types text/html text/css application/x-javascript;
js_set $js_set_string "function () { return 'bar1' }";
js_set $js_set_null "function () { return null }";
js_set $js_set_undefined "function () { return undefined }";
js_set $js_set_number "function () { return 123 }";
js_set $js_set_property "function (r) { r.rootMe(); return r.property = 'property' }";
access_log off;
sendfile on;
keepalive_timeout 65;
server
{
listen 127.0.0.1:19090;
server_name _;
root html;
set $js_request_variables_a "abc";
set $js_request_variables_b "${js_request_variables_a}123";
set $js_request_variables_j "xx${js_set_string}xx";
set $js_request_variables_v "";
location /
{
index index.html;
}
location /demo/
{
js 'Handler.demo';
}
location /run/
{
js 'Handler.run';
}
location /run/request-body-file
{
client_body_in_file_only on;
js 'Handler.run';
}
location = /variable-set
{
rewrite ^ /run/variable-set?string=$js_set_string&null=$js_set_null&undefined=$js_set_undefined&number=$js_set_number&property=$js_set_property? last;
}
location /quick
{
return 403;
}
location /slow
{
proxy_pass http://127.0.0.1:19090/;
proxy_set_header Host "localhost";
}
}
}
Jump to Line
Something went wrong with that request. Please try again.