@@ -7,19 +7,25 @@ upstream domjudge {
7
7
server unix:/var/run/php-fpm-domjudge.sock; # if using with etc/domjudge-fpm.conf
8
8
}
9
9
10
- {% if DOMSERVER_LOADBALANCING %}
10
+ {% if host_type == 'domserver' and DOMSERVER_LOADBALANCING %}
11
11
upstream domjudge-loadbalanced {
12
12
least_conn;
13
+ keepalive 100;
13
14
{% for host in groups ['domserver' ] %}
14
- server {{ hostvars[host] .ansible_host }}:81 ;
15
+ server {{ hostvars[host] .ansible_host }}:444 ;
15
16
{% endfor %}
16
17
}
17
18
18
19
server {
19
- listen 81 ;
20
- listen [::]:81 ;
20
+ listen 444 ssl http2 ;
21
+ listen [::]:444 ssl http2 ;
21
22
server_name _default_;
22
23
24
+ ssl_certificate {{DOMSERVER_SSL_CERT}};
25
+ ssl_certificate_key {{DOMSERVER_SSL_KEY}};
26
+ ssl_session_timeout 5m;
27
+ ssl_prefer_server_ciphers on;
28
+
23
29
add_header Strict-Transport-Security max-age=31556952;
24
30
include /etc/nginx/snippets/domjudge-inner;
25
31
@@ -30,6 +36,7 @@ server {
30
36
31
37
map $realip_remote_addr $access_allowed {
32
38
default false;
39
+ {{ DOMSERVER_IP }} true;
33
40
{% for host in groups ['domserver' ] %}
34
41
{{ hostvars[host] .ansible_host }} true;
35
42
{% endfor %}
@@ -55,12 +62,11 @@ server {
55
62
56
63
add_header Strict-Transport-Security max-age=31556952;
57
64
58
- {% if DOMSERVER_LOADBALANCING %}
65
+ {% if host_type == 'domserver' and DOMSERVER_LOADBALANCING %}
59
66
location / {
60
- proxy_pass http ://domjudge-loadbalanced;
67
+ proxy_pass https ://domjudge-loadbalanced;
61
68
proxy_http_version 1.1;
62
- proxy_set_header Upgrade $http_upgrade;
63
- proxy_set_header Connection "upgrade";
69
+ proxy_set_header Connection "";
64
70
proxy_set_header X-Forwarded-Proto $scheme;
65
71
proxy_set_header Host $http_host;
66
72
proxy_set_header X-Real-IP $remote_addr;
0 commit comments