717d5cf87de77bdaf03a3933936d179f24f52fa0
[holmes/rule-management.git] / rulemgt-standalone / src / main / assembly / nginx-http.conf
1 #user  nobody;
2 worker_processes  1;
3
4 error_log  logs/error.log;
5 error_log  logs/error.log  notice;
6 error_log  logs/error.log  info;
7
8 pid        logs/nginx.pid;
9
10
11 events {
12     worker_connections  1024;
13 }
14
15
16 http {
17     include       mime.types;
18     default_type  application/octet-stream;
19
20     log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
21                       '$status $body_bytes_sent "$http_referer" '
22                       '"$http_user_agent" "$http_x_forwarded_for"';
23
24     #access_log  logs/access.log  main;
25
26     sendfile        on;
27
28     keepalive_timeout  65;
29
30     server {
31         listen       9104;
32         server_name  _;
33
34         location / {
35             root   /usr/local/openresty/nginx/html;
36
37             proxy_set_header Host $host;
38             proxy_set_header X-Real-IP $remote_addr;
39             proxy_redirect off;
40
41             if ($uri ~ "/api/holmes-rule-mgmt/(.*)") {
42                 proxy_pass http://$host:9101$request_uri;
43                 break;
44             }
45
46             if ($uri ~ "/api/holmes-engine-mgmt/(.*)") {
47                 proxy_pass http://$host:9102$request_uri;
48                 break;
49             }
50         }
51
52         location ~*.(htm|html){
53             add_header Cache-Control no-cache;
54             root html;
55         }
56     }
57 }