upstream service { ip_hash; server {{ jerico_docker_stack_name }}_{{ jerico_docker_catalogue_service_name }}:{{ jerico_catalogue_ui_port }}; } # added to import pep script js_import pep.js; # added to bind enforce function js_set $authorization pep.enforce; # variables computed by njs and which may possibly be passed among locations js_var $auth_token; js_var $account_record; proxy_cache_path /tmp levels=1:2 keys_zone=social_cache:10m max_size=10g inactive=60m use_temp_path=off; server { listen *:80; listen [::]:80; server_name {{ bluecloud_jerico_service_host }}; subrequest_output_buffer_size 200k; location /health { add_header Content-Length 0; add_header Content-Type "text/plain"; return 200; } location / { proxy_read_timeout 300; proxy_send_timeout 300; js_content pep.enforce; } location /gcube_user_info { internal; gunzip on; proxy_method GET; proxy_http_version 1.1; proxy_set_header gcube-token "$auth_token"; proxy_pass https://api.d4science.org/rest/2/people/profile; proxy_cache social_cache; proxy_cache_key $auth_token; } location /_backend { internal; proxy_read_timeout 300; proxy_send_timeout 300; resolver 146.48.122.10; proxy_http_version 1.1; proxy_set_header gcube-token "$auth_token"; proxy_pass http://service$request_uri; } location /_accounting { internal; proxy_method POST; proxy_http_version 1.1; proxy_set_header gcube-token "$auth_token"; proxy_set_header Content-Type "application/json"; proxy_pass https://accounting-service.d4science.org/accounting-service/record; } }