-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathvirtual.example.com.conf
65 lines (58 loc) · 1.91 KB
/
virtual.example.com.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
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
60
61
62
63
64
65
server{
listen 80;
listen 8080;
Listen 443;
server_name "";
return 444;
}
server {
listen 80 backlog=4096; ### set net.core.somaxconn = 4096
server_name virtual.example.com www.virtual.example.com;
gzip on;
gzip_types text/plain application/xml;
gzip_proxied no-cache no-store private expired auth;
gzip_min_length 1000;
# gunzip on; might not be included in nginx by default, need builded with --with-http_gzip_static_module
# gzip_static on; might not be included in nginx by default, need builded with --with-http_gzip_static_module
location / {
proxy_pass http://localhost:8080;
proxy_bind 127.0.0.1; ### proxy server and proxied server are on the same server
proxy_buffers 16 4K;
proxy_buffer_size 2K;
proxy_set_header HOST $proxy_host;
proxy_set_header ORIGIN-HOST $host;
proxy_set_header X-Real-IP $remote_addr;
}
location ~ \.(jpg|png|gif)$ {
root /data/images;
try_files $uri /default.gif; ### /data/images/$uri or /data/images/default.gif
# try_files $uri $uri/ $uri.html =404;
}
location /gotooutside/ {
return 301 https://www.nginx.com/;
}
}
server {
listen 8080 backlog=4096; ### set net.core.somaxconn = 4096
server_name 127.0.0.1 localhost;
location / {
root /data/www;
index index.html;
}
error_page 404 = /error/404.html;
error_page 502 = /error/502.html;
location = /download/nginx/ {
error_page 404 =301 http://nginx.org/en/download.html;
}
location /old/file/upload/ {
error_page 404 = /store$uri;
}
location /store/ {
root /data;
}
location /error/ {
root /data;
}
sub_filter 'href="http:' 'href="https:';
sub_filter_once off;
}