# nginx.conf -- docker-openresty # # This file is installed to: # `/usr/local/openresty/nginx/conf/nginx.conf` # and is the file loaded by nginx at startup, # unless the user specifies otherwise. # # It tracks the upstream OpenResty's `nginx.conf`, but removes the `server` # section and adds this directive: # `include /etc/nginx/conf.d/*.conf;` # # The `docker-openresty` file `nginx.vh.default.conf` is copied to # `/etc/nginx/conf.d/default.conf`. It contains the `server section # of the upstream `nginx.conf`. # # See https://github.com/openresty/docker-openresty/blob/master/README.md#nginx-config-files #
#user nobody; #worker_processes 1;
# Enables the use of JIT for regular expressions to speed-up their processing. pcre_jiton;
http { include mime.types; default_type application/octet-stream;
# Enables or disables the use of underscores in client request header fields. # When the use of underscores is disabled, request header fields whose names contain underscores are marked as invalid and become subject to the ignore_invalid_headers directive. # underscores_in_headers off;
# Buffer represents the register inform and the queue of the finished segment lua_shared_dict tracing_buffer 100m;
# Init is the timer setter and keeper # Setup an infinite loop timer to do register and trace report. init_worker_by_lua_block { local metadata_buffer = ngx.shared.tracing_buffer
-- Set service name metadata_buffer:set('serviceName', '192.168.56.20') -- Instance means the number of Nginx deployment, does not mean the worker instances metadata_buffer:set('serviceInstanceName', '192.168.56.20') -- type 'boolean', mark the entrySpan include host/domain metadata_buffer:set('includeHostInEntrySpan', true)
-- set random seed require("skywalking.util").set_randomseed() require("skywalking.client"):startBackendTimer("http://skywalking-oap:12800")
-- If there is a bug of this `tablepool` implementation, we can -- disable it in this way -- require("skywalking.util").disable_tablepool()
location / { rewrite_by_lua_block { ------------------------------------------------------ -- NOTICE, this should be changed manually -- This variable represents the upstream logic address -- Please set them as service logic name or DNS name -- -- Currently, we can not have the upstream real network address ------------------------------------------------------ skywalking_tracer:start(ngx.var.host) -- If you want correlation custom data to the downstream service -- skywalking_tracer:start(ngx.var.host, {custom = "custom_value"}) }