forked from iyserver/blog
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathnginx.conf
More file actions
59 lines (40 loc) · 1.55 KB
/
nginx.conf
File metadata and controls
59 lines (40 loc) · 1.55 KB
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#user nobody;
worker_processes 1;
#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
#pid logs/nginx.pid;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
#access_log logs/access.log main;
sendfile on;
#tcp_nopush on;
#keepalive_timeout 0;
keepalive_timeout 65;
#gzip on;
server {
listen 80;
server_name localhost;
location / {
proxy_pass https://dev-iceyear.pantheonsite.io;
# 替换指定字符串
sub_filter dev-iceyear.pantheonsite.io blog.iceyear.ml;
# 字符串只进行一次替换,即只替换第一个被匹配的字符串。这里关闭。
sub_filter_once off;
# 指定头部:
proxy_set_header Host "dev-iceyear.pantheonsite.io";
proxy_set_header Referer $http_referer;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header User-Agent $http_user_agent;
# 防止谷歌返回压缩的内容,因为压缩的内容无法替换字符串
proxy_set_header Accept-Encoding "";
}
}
}