Add locations
Add script and /api/ locations to support hugo analytics TASK: Secure access e.g private network URL for admin page; restrict public pages
This commit is contained in:
@@ -86,6 +86,39 @@ server {
|
||||
proxy_set_header Referer $http_referer;
|
||||
proxy_redirect off;
|
||||
|
||||
proxy_set_header Cookie $http_cookie;
|
||||
}
|
||||
# 1. Allow public access to tracking scripts
|
||||
location ~ ^/(script\.js|umami\.js)$ {
|
||||
proxy_pass http://$umami_backend;
|
||||
|
||||
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 X-Forwarded-Proto https; # $scheme;
|
||||
proxy_set_header X-Forwarded-Host $host;
|
||||
|
||||
proxy_buffering off;
|
||||
proxy_set_header Referer $http_referer;
|
||||
proxy_redirect off;
|
||||
|
||||
proxy_set_header Cookie $http_cookie;
|
||||
}
|
||||
|
||||
# 2. Allow public access to tracking API (metrics collection)
|
||||
location /api/send {
|
||||
proxy_pass http://$umami_backend;
|
||||
|
||||
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 X-Forwarded-Proto https; # $scheme;
|
||||
proxy_set_header X-Forwarded-Host $host;
|
||||
|
||||
proxy_buffering off;
|
||||
proxy_set_header Referer $http_referer;
|
||||
proxy_redirect off;
|
||||
|
||||
proxy_set_header Cookie $http_cookie;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user