Update nginx/rsyslog config to add specific log for LOGWARN or above
[matches/MCTX3420.git] / server-configs / nginx / sites-enabled / mctxconfig
1 server {
2         listen 80;
3
4         #Change this to match your root directory
5         root /usr/share/nginx/www;
6         index index.php index.html index.htm;
7
8         # Make site accessible from http://localhost/
9         server_name localhost;
10
11         location / {
12                 # First attempt to serve request as file, then
13                 # as directory, then fall back to displaying a 404.
14                 try_files $uri $uri/ =404;
15                 # Uncomment to enable naxsi on this location
16                 # include /etc/nginx/naxsi.rules
17         }
18
19         # Only for nginx-naxsi used with nginx-naxsi-ui : process denied requests
20         #location /RequestDenied {
21         #       proxy_pass http://127.0.0.1:8080;    
22         #}
23
24         #error_page 404 /404.html;
25
26         # redirect server error pages to the static page /50x.html
27         #
28         #error_page 500 502 503 504 /50x.html;
29         #location = /50x.html {
30         #       root /usr/share/nginx/html;
31         #}
32
33         # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
34         #
35         location ~ \.php$ {
36                 fastcgi_split_path_info ^(.+\.php)(/.+)$;
37         #       # NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini
38         #
39         #       # With php5-cgi alone:
40         #       fastcgi_pass 127.0.0.1:9000;
41         #       # With php5-fpm:
42                 fastcgi_pass unix:/var/run/php5-fpm.sock;
43                 fastcgi_index index.php;
44                 include fastcgi_params;
45         }
46
47         # deny access to .htaccess files, if Apache's document root
48         # concurs with nginx's one
49         #
50         location ~ /\.ht {
51                 deny all;
52         }
53         
54         #MCTX API
55         location /api {
56                 #Login area
57                 location ^~ /api/control {
58                         #Uncomment to add back login
59                         #auth_basic "Restricted Access";
60                         #auth_basic_user_file /usr/share/nginx/access/.htpasswd;
61         
62                         fastcgi_pass 127.0.0.1:9005;
63                         fastcgi_param DOCUMENT_URI_LOCAL control;
64                         include fastcgi_params;
65                 }
66
67                 #Program log
68                 location ^~ /api/log {
69                         alias /var/log/mctxserv.log;
70                         default_type text/plain;
71                 }
72
73                 #Program error log
74                 location ^~ /api/errorlog {
75                         alias /var/log/mctxserv-error.log;
76                         default_type text/plain;
77                 }
78
79                 location ~ ^/api/?([^?]*) {
80                         fastcgi_pass 127.0.0.1:9005;
81                         fastcgi_param DOCUMENT_URI_LOCAL $1;
82                         include fastcgi_params;
83                 }
84         }
85 }
86
87
88 # another virtual host using mix of IP-, name-, and port-based configuration
89 #
90 #server {
91 #       listen 8000;
92 #       listen somename:8080;
93 #       server_name somename alias another.alias;
94 #       root html;
95 #       index index.html index.htm;
96 #
97 #       location / {
98 #               try_files $uri $uri/ =404;
99 #       }
100 #}
101
102
103 # HTTPS server
104 #
105 #server {
106 #       listen 443;
107 #       server_name localhost;
108 #
109 #       root html;
110 #       index index.html index.htm;
111 #
112 #       ssl on;
113 #       ssl_certificate cert.pem;
114 #       ssl_certificate_key cert.key;
115 #
116 #       ssl_session_timeout 5m;
117 #
118 #       ssl_protocols SSLv3 TLSv1;
119 #       ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv3:+EXP;
120 #       ssl_prefer_server_ciphers on;
121 #
122 #       location / {
123 #               try_files $uri $uri/ =404;
124 #       }
125 #}

UCC git Repository :: git.ucc.asn.au