Skip to content

Commit 11900dd

Browse files
committed
Nginx config to workaround Bunny being blocked
1 parent 1fb1b3e commit 11900dd

1 file changed

Lines changed: 33 additions & 0 deletions

File tree

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
server {
2+
root /usr/share/nginx/www;
3+
index index.html index.htm;
4+
5+
server_name img.quan.hoabinh.vn;
6+
7+
access_log /var/log/nginx/img.quan.hoabinh.vn/access.log;
8+
error_log /var/log/nginx/img.quan.hoabinh.vn/error.log;
9+
10+
location / {
11+
proxy_pass https://quan-images.b-cdn.net;
12+
proxy_set_header Host quan-images.b-cdn.net;
13+
# Do NOT forward X-Forwarded-For / X-Real-IP / X-Forwarded-Proto
14+
# Bunny's edge sets its own and blocks requests that arrive with them
15+
16+
# Forward browser headers for content negotiation (nice to have, but not a must)
17+
proxy_set_header User-Agent $http_user_agent;
18+
proxy_set_header Accept $http_accept;
19+
proxy_set_header Accept-Language $http_accept_language;
20+
proxy_set_header Accept-Encoding $http_accept_encoding;
21+
proxy_set_header Referer $http_referer;
22+
23+
}
24+
25+
listen 80;
26+
listen [::]:80;
27+
listen 443 ssl;
28+
listen [::]:443 ssl;
29+
http2 on;
30+
31+
ssl_certificate /etc/letsencrypt/live/img.quan.hoabinh.vn/fullchain.pem;
32+
ssl_certificate_key /etc/letsencrypt/live/img.quan.hoabinh.vn/privkey.pem;
33+
}

0 commit comments

Comments
 (0)