lan-to-nginx/nginx.conf

45 lines
1.6 KiB
Nginx Configuration File

user nginx;
worker_processes 1;
events {
worker_connections 1024;
}
http {
default_type application/octet-stream;
server {
listen 80;
add_header Content-Security-Policy "default-src * 'unsafe-inline' 'unsafe-eval'; img-src * data:; font-src * data:;";
# add_header Content-Security-Policy "default-src 'self'; script-src 'self' https://ack.nixc.us; style-src 'self'; img-src 'self'; font-src 'self'; connect-src 'self'; frame-ancestors 'self'; form-action 'self';";
# Define MIME type
types {
text/html html htm shtml;
}
location / {
# Use the placeholders for the proxy pass
proxy_pass ${PROTOCOL}://${BACKEND_ADDRESS}:${BACKEND_PORT};
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Accept-Encoding "";
proxy_buffering off;
proxy_ssl_verify off; # Skip SSL verification, be cautious
# Enable response body filtering
sub_filter_once off;
# Inject the Matomo content just before </head>
sub_filter '</body>' '<script async src="https://ack.nixc.us/tracker.js" data-ackee-server="https://ack.nixc.us" data-ackee-domain-id="9608c1ff-b08c-4781-ae7e-cee6eb415bf3"></script></body>';
sub_filter_types application/xml application/json text/css text/javascript application/javascript text/plain;
}
}
}