# 票据属于资源凭据,日志保留资源路径但不记录明文票据。 map $uri $rawmark_log_path { ~^/api/v1/resources/[^/]+(?/.*)$ /api/v1/resources/[redacted]$rawmark_resource_suffix; default $uri; } log_format rawmark '$remote_addr - $remote_user [$time_local] ' '"$request_method $rawmark_log_path $server_protocol" $status $body_bytes_sent ' '"$http_user_agent"'; # raw.134333.xyz -> RawMark 容器(127.0.0.1:21000) server { listen 80; server_name raw.134333.xyz; return 308 https://raw.134333.xyz$request_uri; } server { listen 443 ssl; http2 on; server_name raw.134333.xyz; include /etc/nginx/snippets/ssl-134333.xyz.conf; include /etc/nginx/snippets/no-spider.conf; access_log /var/log/nginx/raw.134333.xyz.log rawmark; error_log /var/log/nginx/raw.134333.xyz.error.log warn; location / { proxy_pass http://127.0.0.1:21000; proxy_http_version 1.1; proxy_buffering off; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection $connection_upgrade; proxy_set_header Host $http_host; proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_read_timeout 1h; # Nginx 错误日志不能脱敏请求行;票据路径只保留脱敏访问日志和应用错误日志。 location ^~ /api/v1/resources/ { proxy_pass http://127.0.0.1:21000; error_log /dev/null; } } }