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

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