e2e-tests/oauth-flow/openid4vp/resource/nginx.conf
load_module /usr/lib/nginx/modules/ngx_http_js_module.so;
user nginx;
worker_processes 1;
error_log /var/log/nginx/error.log debug;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
js_import oauth2.js;
include /etc/nginx/mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;
keepalive_timeout 65;
include /etc/nginx/conf.d/*.conf;
upstream nodeA-backend {
server nodeA-backend:8081;
}
server {
server_name resource;
listen 80;
http2 on;
# check access via token introspection as described by https://www.nginx.com/blog/validating-oauth-2-0-access-tokens-nginx/
location /resource {
js_content oauth2.introspectAccessToken;
}
# Location in javascript subrequest.
# this is needed to set headers and method
location /_oauth2_send_request {
internal;
proxy_method POST;
proxy_set_header Content-Type "application/x-www-form-urlencoded";
proxy_pass http://nodeA-backend/internal/auth/v2/accesstoken/introspect;
}
location /_dpop_send_request {
internal;
proxy_method POST;
proxy_set_header Content-Type "application/json";
proxy_pass http://nodeA-backend/internal/auth/v2/dpop/validate;
}
}
}