-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathnginx.config
56 lines (47 loc) · 1.32 KB
/
nginx.config
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
worker_processes 4;
pid /var/log/nginx/nginx.pid;
events {
worker_connections 768;
}
http {
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
include /etc/nginx/mime.types;
default_type application/octet-stream;
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
gzip on;
gzip_http_version 1.0;
gzip_disable "msie6";
gzip_min_length 512;
gzip_proxied expired no-cache no-store private auth;
gzip_types application/xml application/x-javascript application/javascript text/css image/svg+xml;
include /etc/nginx/conf.d/*.conf;
upstream api {
server 127.0.0.1:9000;
}
server {
listen 80;
include /etc/nginx/mime.types;
server_name penghu-jen-975389.middle2.me;
error_page 405 = $uri;
location ~ ^/(.*)$ {
root /srv/web/static/;
try_files /$1 /$1/index.html @apiserver;
}
location @apiserver {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header X-NginX-Proxy true;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_cookie_domain localhost $host;
proxy_pass http://api;
proxy_redirect off;
#limit_req zone=api burst=7 nodelay;
}
}
}