server {
listen 80;
server_name _;
#charset koi8-r;
#access_log logs/host.access.log main;
location / {
root /usr/share/nginx/html;
index index.php index.html index.htm;
}
location = /js/script.js {
# Change this if you use a different variant of the script
proxy_pass https://plausible.io/js/script.js;
# Tiny, negligible performance improvement. Very optional.
proxy_buffering on;
# Optional. Adds a header to tell if you got a cache hit or miss
add_header X-Cache $upstream_cache_status;
}
location = /api/event {
proxy_pass https://plausible.io/api/event;
proxy_buffering on;
proxy_http_version 1.1;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Host $host;
}
error_page 404 /404.html;
location = /404.html {
root /usr/share/nginx/html;
}
}
view raw nginx.conf hosted with ❤ by GitHub