File tree 2 files changed +33
-15
lines changed
2 files changed +33
-15
lines changed Original file line number Diff line number Diff line change @@ -107,7 +107,7 @@ http {
107
107
108
108
upstream app_server {
109
109
server localhost:8888 fail_timeout=0;
110
- }
110
+ }
111
111
112
112
server {
113
113
listen <%= ENV["PORT"] %> ;
@@ -130,15 +130,33 @@ http {
130
130
rewrite ^ https://$host$request_uri? permanent;
131
131
}
132
132
133
- location / {
134
- proxy_pass http://app_server;
135
- }
136
-
137
- <% if ENV['USE_FASTBOOT'] %>
138
- # Just in case, only forward "/policies" to Ember for a moment
139
- location = /policies {
140
- proxy_pass http://localhost:9000;
141
- }
133
+ <% if ENV['USE_FASTBOOT'] == "staging-experimental" %>
134
+ # Experimentally send all non-backend requests to FastBoot
135
+
136
+ location /api/ {
137
+ proxy_pass http://app_server;
138
+ }
139
+
140
+ # FastBoot
141
+ location / {
142
+ proxy_pass http://localhost:9000;
143
+ }
144
+ <% elsif ['USE_FASTBOOT'] %>
145
+ # Fastboot is enabled only for allowed paths
146
+
147
+ location = /policies {
148
+ proxy_pass http://localhost:9000;
149
+ }
150
+
151
+ location / {
152
+ proxy_pass http://app_server;
153
+ }
154
+ <% else %>
155
+ # FastBoot is disabled, backend sends the static Ember index HTML for non-backend paths
156
+
157
+ location / {
158
+ proxy_pass http://app_server;
159
+ }
142
160
<% end %>
143
161
144
162
location ~ ^/api/v./crates/new$ {
Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
2
set -ue
3
3
4
- if [[ " ${USE_FASTBOOT:- 0} " = 1 ]]; then
5
- export USE_FASTBOOT=1
4
+ if [[ -z " ${USE_FASTBOOT} " ]]; then
5
+ unset USE_FASTBOOT
6
+ bin/start-nginx ./target/release/server
7
+ else
8
+ export USE_FASTBOOT
6
9
node --optimize_for_size --max_old_space_size=200 fastboot.js &
7
10
bin/start-nginx ./target/release/server &
8
11
wait -n
9
- else
10
- unset USE_FASTBOOT
11
- bin/start-nginx ./target/release/server
12
12
fi
You can’t perform that action at this time.
0 commit comments