56 lines
2.2 KiB
Nginx Configuration File

worker_processes 1;
pid /tmp/nginx.pid;
error_log /dev/stderr warn;
events { worker_connections 128; }
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
access_log off;
server_tokens off;
client_max_body_size 4k;
client_body_timeout 5s;
client_header_timeout 5s;
client_body_temp_path /tmp/client;
proxy_temp_path /tmp/proxy;
fastcgi_temp_path /tmp/fastcgi;
uwsgi_temp_path /tmp/uwsgi;
scgi_temp_path /tmp/scgi;
server {
listen 8080;
absolute_redirect off;
root /usr/share/nginx/html;
add_header Cache-Control "no-store" always;
add_header X-Content-Type-Options "nosniff" always;
add_header X-Frame-Options "DENY" always;
add_header Referrer-Policy "no-referrer" always;
add_header Permissions-Policy "camera=(self), microphone=(self), geolocation=(), display-capture=()" always;
add_header Cross-Origin-Opener-Policy "same-origin" always;
add_header Content-Security-Policy "default-src 'none'; script-src 'self'; style-src 'self'; media-src 'self' blob:; connect-src 'self'; worker-src 'self'; object-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'" always;
location = /lesavka-av-test { return 308 /av-test/; }
location = /lesavka-av-test/ { return 308 /av-test/; }
location = /lesavka-av-test/index.html { return 308 /av-test/; }
location = /av-test { return 308 /av-test/; }
location = /av-test/ {
if ($request_method !~ ^(GET|HEAD)$) { return 405; }
try_files /av-test/index.html =404;
}
location ~ ^/av-test/(index\.html|observer\.js|metrics\.js|reporting\.js|activity-worklet\.js|style\.css)$ {
if ($request_method !~ ^(GET|HEAD)$) { return 405; }
try_files $uri =404;
}
location ~ ^/av-test/api/(start|report)$ {
if ($request_method != POST) { return 405; }
proxy_pass http://127.0.0.1:8081;
proxy_connect_timeout 2s;
proxy_read_timeout 5s;
proxy_send_timeout 5s;
proxy_pass_request_headers off;
proxy_set_header Content-Type $http_content_type;
proxy_set_header Origin $http_origin;
proxy_set_header Authorization $http_authorization;
proxy_set_header Host localhost;
}
location / { return 404; }
}
}