Files
RawMark/deploy/nginx/raw.134333.xyz.conf
T

48 lines
1.6 KiB
Plaintext

# Tickets are resource credentials; retain resource paths in logs without plaintext tickets.
map $uri $rawmark_log_path {
~^/api/v1/resources/[^/]+(?<rawmark_resource_suffix>/.*)$ /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 container (127.0.0.1:21000)
server {
listen 80;
server_name raw.134333.xyz;
access_log /var/log/nginx/raw.134333.xyz.log rawmark;
error_log /dev/null;
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 error logs cannot redact request lines; ticket paths retain only redacted access logs and application error logs.
location ^~ /api/v1/resources/ {
proxy_pass http://127.0.0.1:21000;
error_log /dev/null;
}
}
}