-
Notifications
You must be signed in to change notification settings - Fork 1
/
bhub.conf
115 lines (101 loc) · 4.56 KB
/
bhub.conf
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
# this config is mostly based on https://jupyterhub.readthedocs.io/en/stable/reference/config-proxy.html
# top-level http config for websocket headers
# If Upgrade is defined, Connection = upgrade
# If Upgrade is empty, Connection = close
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
upstream bhub-test {
server 194.95.75.9:30193;
server 194.95.75.12:30193;
}
upstream jhub-test {
server 194.95.75.9:30190;
server 194.95.75.12:30190;
}
# HTTP server to redirect notebooks-test.gesis.org 80 traffic to SSL/HTTPS
server {
listen 80;
server_name notebooks-test.gesis.org;
access_log off; # turn off access log
# Tell all requests to port 80 to be 301 (permanently) redirected to HTTPS
return 301 https://$host$request_uri;
}
# HTTPS server for notebooks-test.gesis.org
server {
listen 443;
ssl on;
server_name notebooks-test.gesis.org;
ssl_certificate /etc/letsencrypt/live/notebooks-test.gesis.org/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/notebooks-test.gesis.org/privkey.pem;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;
ssl_dhparam /etc/letsencrypt/dhparam.pem;
ssl_ciphers "ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES256-SHA:ECDHE-ECDSA-DES-CBC3-SHA:ECDHE-RSA-DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:DES-CBC3-SHA:!DSS";
# https://docs.nginx.com/nginx/admin-guide/security-controls/terminating-ssl-http/#https-server-optimization
ssl_session_timeout 1d;
ssl_session_cache shared:SSL:50m; # 50mb shared session cache
ssl_stapling on;
ssl_stapling_verify on;
add_header Strict-Transport-Security max-age=15768000;
access_log off; # turn off access log
client_body_buffer_size 128k; # default is 8k|16k;
client_max_body_size 1G; # default is 1M
proxy_buffers 32 32k;
proxy_buffer_size 32k;
# https://stackoverflow.com/questions/24453388/nginx-reverse-proxy-causing-504-gateway-timeout/36589120#36589120
proxy_http_version 1.1; # default is 1.0
proxy_connect_timeout 120s; # default is 60s
proxy_send_timeout 120s; # default is 60s
proxy_read_timeout 120s; # default is 60s
location = /favicon.ico { access_log off; log_not_found off; }
location / {
proxy_buffering off;
proxy_pass http://bhub-test;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Scheme $scheme;
}
#location /jupyter/ {
# proxy_buffering off;
# proxy_pass http://jhub-test;
#
# proxy_set_header X-Real-IP $remote_addr;
# proxy_set_header Host $host;
# proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
# # websocket headers
# proxy_set_header Upgrade $http_upgrade;
# proxy_set_header Connection $connection_upgrade;
# #proxy_set_header X-Forwarded-Proto $scheme;
# proxy_set_header X-Scheme $scheme;
#}
location ~* ^/hub/?(.*)$ {
proxy_buffering off;
proxy_pass http://jhub-test;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
# websocket headers
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
#proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Scheme $scheme;
}
location ~* ^/(user|services)/?(.*)$ {
proxy_pass http://jhub-test;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
# websocket headers
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
#proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Scheme $scheme;
}
location = /robots.txt {
add_header Content-Type text/plain;
return 200 "User-agent: *\nDisallow: /\n";
}
}