-
Notifications
You must be signed in to change notification settings - Fork 2
/
isle
75 lines (63 loc) · 2.14 KB
/
isle
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# Server configuration for the `isle-server`.
#
# ## Notes
#
# Redirects all HTTP to HTTPS requests.
#
# ## Usage
#
# To enable this configuration file,
#
# ```bash
# $ sudo ln -s /etc/nginx/sites-available/isle /etc/nginx/sites-enabled/isle
# ```
#
server {
listen 80 default_server;
listen [::]:80 default_server;
server_name isle.heinz.cmu.edu;
# Redirect to the `https` host (declared below) with a `301` Moved Permanently response.
return 301 https://$server_name$request_uri;
}
# Set a configuration for a virtual server.
#
# See: http://nginx.org/en/docs/http/ngx_http_core_module.html#server
server {
# Set the port.
#
# See: http://nginx.org/en/docs/http/ngx_http_core_module.html#listen
listen 443;
ssl on;
# Specify the absolute file path of a certificate for the given virtual server.
#
# See: http://nginx.org/en/docs/http/ngx_http_ssl_module.html#ssl_certificate
ssl_certificate /srv/ssl/isle_heinz_cmu_edu_concatenated.cer;
# Specify the absolute file path of the secret key for the given virtual server.
#
# See: http://nginx.org/en/docs/http/ngx_http_ssl_module.html#ssl_certificate_key
ssl_certificate_key /srv/ssl/isle.heinz.cmu.edu.key;
# Specify the absolute path to the root directory for requests. Should be equal to the directory in which the the `isle-server` program resides.
#
# See: http://nginx.org/en/docs/http/ngx_http_core_module.html#root
root /var/www/isle-server/;
# Set the virtual server names.
#
# See: http://nginx.org/en/docs/http/ngx_http_core_module.html#server_name
server_name isle.heinz.cmu.edu;
add_header Strict-Transport-Security "max-age=31536000";
# Set maximum file / lessons sizes that may be uploaded to 20MB:
client_max_body_size 20M;
# Define a root location directive:
location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $http_host;
proxy_pass https://127.0.0.1:17777/;
# Ensure websockets can be established:
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
location /dashboard/ {
alias /var/www/isle-dashboard/;
}
}