-
Notifications
You must be signed in to change notification settings - Fork 8
/
blog.conf
30 lines (29 loc) · 842 Bytes
/
blog.conf
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
30
server{
listen 800;
server_name localhost;
root /etc/nginx/dist;
location = /service-worker.js {
add_header cache-control no-store;
root /etc/nginx/dist;
}
location = /sitemap.txt {
proxy_pass http://dockerhost:3000/robot/sitemap.txt;
}
location / {
if ($http_user_agent ~* "Twitterbot|Baiduspider|Googlebot|Applebot|SEOkicks-Robot|DotBot|YunGuanCe|Exabot|spiderman|Scrapy|HttpClient|Teleport|CalabashTest") {
rewrite ^(.*)$ /robot$1 break;
proxy_pass http://dockerhost:3000;
}
try_files $uri $uri/ @router;
index index.html;
}
location @router {
rewrite ^.*$ /index.html last;
}
location /api {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
rewrite ^/api/(.*)$ /$1 break;
proxy_pass http://dockerhost:3000;
}
}