149115250b007dd22513e3dbb3fe3f2c4eb266ee
[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/html;
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                 location ~ ^/api/?([^?]*) {
74                         fastcgi_pass 127.0.0.1:9005;
75                         fastcgi_param DOCUMENT_URI_LOCAL $1;
76                         include fastcgi_params;
77                 }
78         }
79 }
80
81
82 # another virtual host using mix of IP-, name-, and port-based configuration
83 #
84 #server {
85 #       listen 8000;
86 #       listen somename:8080;
87 #       server_name somename alias another.alias;
88 #       root html;
89 #       index index.html index.htm;
90 #
91 #       location / {
92 #               try_files $uri $uri/ =404;
93 #       }
94 #}
95
96
97 # HTTPS server
98 #
99 #server {
100 #       listen 443;
101 #       server_name localhost;
102 #
103 #       root html;
104 #       index index.html index.htm;
105 #
106 #       ssl on;
107 #       ssl_certificate cert.pem;
108 #       ssl_certificate_key cert.key;
109 #
110 #       ssl_session_timeout 5m;
111 #
112 #       ssl_protocols SSLv3 TLSv1;
113 #       ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv3:+EXP;
114 #       ssl_prefer_server_ciphers on;
115 #
116 #       location / {
117 #               try_files $uri $uri/ =404;
118 #       }
119 #}

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