-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnginx.conf
More file actions
29 lines (24 loc) · 972 Bytes
/
Copy pathnginx.conf
File metadata and controls
29 lines (24 loc) · 972 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
upstream pixel {
server 127.0.0.1:9102;
}
server {
listen 443 ssl http2;
server_name api.frkn.org;
server_tokens off;
ssl_certificate /etc/letsencrypt/live/api.frkn.org/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/api.frkn.org/privkey.pem;
# Trailing slash is important: nginx strips /pixel/ before passing
# the request to the agent, and the admin UI uses relative API paths.
location /pixel/ {
auth_basic "Pixel Admin";
auth_basic_user_file /etc/nginx/.htpasswd_pixel;
proxy_pass http://pixel/;
proxy_http_version 1.1;
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 $scheme;
}
}
# The public pixel image itself is served directly by nginx on media.frkn.org
# and writes to /var/log/nginx/pixel.log; it should NOT be proxied here.