File tree Expand file tree Collapse file tree 3 files changed +31
-2
lines changed Expand file tree Collapse file tree 3 files changed +31
-2
lines changed Original file line number Diff line number Diff line change @@ -13,4 +13,5 @@ interface IServerBlockDetails {
1313 keyPath ?: string
1414 customErrorPagesDirectory : string
1515 staticWebRoot : string
16+ redirectToPath ?: string
1617}
Original file line number Diff line number Diff line change @@ -285,6 +285,14 @@ class LoadBalancerManager {
285285 nginxConfigTemplate
286286 serverWithSubDomain . httpBasicAuth = httpBasicAuth
287287
288+ if (
289+ webApp . redirectDomain &&
290+ serverWithSubDomain . publicDomain !==
291+ webApp . redirectDomain
292+ ) {
293+ serverWithSubDomain . redirectToPath = `http://${ webApp . redirectDomain } `
294+ }
295+
288296 servers . push ( serverWithSubDomain )
289297
290298 // adding custom domains
@@ -296,7 +304,7 @@ class LoadBalancerManager {
296304 idx ++
297305 ) {
298306 const d = customDomainArray [ idx ]
299- servers . push ( {
307+ const newServerBlock : IServerBlockDetails = {
300308 containerHttpPort : httpPort ,
301309 hasSsl : d . hasSsl ,
302310 forceSsl : forceSsl ,
@@ -307,7 +315,15 @@ class LoadBalancerManager {
307315 staticWebRoot : '' ,
308316 customErrorPagesDirectory : '' ,
309317 httpBasicAuth : httpBasicAuth ,
310- } )
318+ }
319+ if (
320+ webApp . redirectDomain &&
321+ newServerBlock . publicDomain !==
322+ webApp . redirectDomain
323+ ) {
324+ newServerBlock . redirectToPath = `http://${ webApp . redirectDomain } `
325+ }
326+ servers . push ( newServerBlock )
311327 }
312328 }
313329 } )
Original file line number Diff line number Diff line change @@ -57,6 +57,18 @@ server {
5757
5858 location / {
5959
60+
61+ <%
62+ if (s .redirectToPath ) {
63+ % >
64+ return 302 < %- s .redirectToPath % >
65+ < %
66+ }
67+ %>
68+
69+
70+
71+
6072 <%
6173 if (s .httpBasicAuthPath ) {
6274 % >
You can’t perform that action at this time.
0 commit comments