<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Dear all,</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
I am currently trying to implement a 503 reply with specific pages. I basically have a nginx config which is using GEOIP.</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
All the html files load fine with a 200 reply, however I am trying to change the reply to 503 and still show the same page.</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Is it possible for this to be done ?</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
The below is an example of the html file.</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
# location of all html files that can be called.
<div>location ~ (/static/*|/5xx_errors.html)</div>
<div>{</div>
<div>        #kill cache</div>
<div>        add_header Last-Modified $date_gmt;</div>
<div>        #add_header Cache-Control 'no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0';</div>
<div>        if_modified_since off;</div>
<div>        expires off;</div>
<div>        etag off;</div>
<div>        add_header Cache-Control 'must-revalidate';</div>
<div>}</div>
<div><br>
</div>
<div>location /{</div>
<div>   index $site_index_file ;</div>
<div>   try_files 5xx_error.html =503;</div>
<div>### Condition statement to store Geo location variable and use that against the user agent to determine page to load</div>
<div>set $cond "${geoip2_data_country_code}";</div>
<div><br>
</div>
<div>if ($http_user_agent ~* "iphone|android") {</div>
<div>   set $cond "${cond}X";</div>
<div>}</div>
<div><br>
</div>
<div>}</div>
<span>}</span><br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span><br>
</span></div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span>What this is doing is give a 503 error and the html file is not being shown.</span></div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span><br>
</span></div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span>Thanks & Regards,</span></div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
tony</div>
</body>
</html>