@@ -18,10 +18,10 @@ server {
18
18
add_header X-Content-Type-Options nosniff;
19
19
20
20
if ($ssl_protocol = "") {
21
- return 301 https://$host$request_uri;
21
+ return 308 https://$host$request_uri;
22
22
}
23
23
24
- index index.html index.htm index.php ;
24
+ index index.html;
25
25
26
26
access_log /var/log/nginx/st2webui.access.log combined;
27
27
error_log /var/log/nginx/st2webui.error.log;
@@ -37,21 +37,27 @@ server {
37
37
ssl_session_cache shared:SSL:10m;
38
38
ssl_session_timeout 5m;
39
39
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
40
- ssl_ciphers EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH:ECDHE-RSA-AES128-GCM-SHA384:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA128:DHE-RSA-AES128-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES128-GCM-SHA128:ECDHE-RSA-AES128-SHA384:ECDHE-RSA-AES128-SHA128:ECDHE-RSA-AES128-SHA:ECDHE-RSA-AES128-SHA:DHE-RSA-AES128-SHA128:DHE-RSA-AES128-SHA128:DHE-RSA-AES128-SHA:DHE-RSA-AES128-SHA:ECDHE-RSA-DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA: AES128-GCM-SHA384:AES128-GCM-SHA128:AES128-SHA128:AES128-SHA128:AES128-SHA:AES128-SHA:DES-CBC3 -SHA:HIGH:!aNULL:!eNULL:!EXPORT:!DES:!MD5:!PSK:!RC4;
40
+ ssl_ciphers EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH:ECDHE-RSA-AES128-GCM-SHA384:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA128:DHE-RSA-AES128-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES128-GCM-SHA128:ECDHE-RSA-AES128-SHA384:ECDHE-RSA-AES128-SHA128:ECDHE-RSA-AES128-SHA:ECDHE-RSA-AES128-SHA:DHE-RSA-AES128-SHA128:DHE-RSA-AES128-SHA128:DHE-RSA-AES128-SHA:DHE-RSA-AES128-SHA:AES128-GCM-SHA384:AES128-GCM-SHA128:AES128-SHA128:AES128-SHA128:AES128-SHA:AES128-SHA:HIGH:!aNULL:!eNULL:!EXPORT:!DES:!MD5:!PSK:!RC4;
41
41
ssl_prefer_server_ciphers on;
42
42
43
- index index.html index.htm index.php ;
43
+ index index.html;
44
44
45
45
access_log /var/log/nginx/ssl-st2webui.access.log combined;
46
46
error_log /var/log/nginx/ssl-st2webui.error.log;
47
47
48
48
add_header Front-End-Https on;
49
49
add_header X-Content-Type-Options nosniff;
50
50
51
+ location @apiError {
52
+ add_header Content-Type application/json always;
53
+ return 503 '{ "faultstring": "Nginx is unable to reach st2api. Make sure service is running." }';
54
+ }
55
+
51
56
location /api/ {
52
- rewrite ^/api/(.*) /api/$1 break ;
57
+ error_page 502 = @apiError ;
53
58
54
59
proxy_pass https://st2/api/;
60
+ proxy_next_upstream error timeout http_500 http_502 http_503 http_504;
55
61
proxy_read_timeout 90;
56
62
proxy_connect_timeout 90;
57
63
proxy_redirect off;
@@ -67,7 +73,7 @@ server {
67
73
proxy_set_header Host $host;
68
74
}
69
75
70
- location @streamError {
76
+ location @streamError {
71
77
add_header Content-Type text/event-stream;
72
78
return 200 "retry: 1000\n\n";
73
79
}
@@ -79,9 +85,8 @@ server {
79
85
location /stream/ {
80
86
error_page 502 = @streamError;
81
87
82
- rewrite ^/stream/(.*) /$1 break;
83
-
84
88
proxy_pass https://st2/stream/;
89
+ proxy_next_upstream error timeout http_500 http_502 http_503 http_504;
85
90
proxy_set_header Host $host;
86
91
proxy_set_header X-Real-IP $remote_addr;
87
92
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
@@ -99,10 +104,16 @@ server {
99
104
proxy_cache off;
100
105
}
101
106
107
+ location @authError {
108
+ add_header Content-Type application/json always;
109
+ return 503 '{ "faultstring": "Nginx is unable to reach st2auth. Make sure service is running." }';
110
+ }
111
+
102
112
location /auth/ {
103
- rewrite ^/auth/(.*) /auth/$1 break ;
113
+ error_page 502 = @authError ;
104
114
105
115
proxy_pass https://st2/auth/;
116
+ proxy_next_upstream error timeout http_500 http_502 http_503 http_504;
106
117
proxy_read_timeout 90;
107
118
proxy_connect_timeout 90;
108
119
proxy_redirect off;
@@ -118,11 +129,10 @@ server {
118
129
proxy_cache off;
119
130
proxy_set_header Host $host;
120
131
}
121
-
122
- location /mistral/ {
123
- rewrite ^/mistral/(.*) /mistral/$1 break;
124
132
133
+ location /mistral/ {
125
134
proxy_pass https://st2/mistral/;
135
+ proxy_next_upstream error timeout http_500 http_502 http_503 http_504;
126
136
proxy_read_timeout 90;
127
137
proxy_connect_timeout 90;
128
138
proxy_redirect off;
@@ -141,6 +151,10 @@ server {
141
151
142
152
location / {
143
153
root /opt/stackstorm/static/webui/;
144
- index index.html index.htm index.php;
154
+ index index.html;
155
+
156
+ sendfile on;
157
+ tcp_nopush on;
158
+ tcp_nodelay on;
145
159
}
146
160
}
0 commit comments