You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: ETS website maintenance howto.md
+69-32Lines changed: 69 additions & 32 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,9 +3,24 @@
3
3
4
4
# Echothrust Solutions website maintenance HOWTO
5
5
6
-
This is a small howto on how we perform scheduled maintenance on our websites that require a database update or re-import.
6
+
This is a small paper on a method we employ in order to perform scheduled maintenance on our web servers.
7
7
8
-
The guide assumes you're running OpenBSD and nginx but the principles can be applied to a variety of applications and services.
8
+
The guide assumes you're running `OpenBSD` and `nginx` but the principles can be applied to a variety of applications and services.
9
+
10
+
The method as its pros and cons but they depend on your own requirements and limitations. In our case we are quite happy with this method and we've been using ever since.
11
+
* It allows you to stop the web server for your site completely so you can perform updates. But this comes at the penalty of having to maintain an extra service
12
+
* It is fairly simple to "script" and automate
13
+
* It assumes that both web services run on the same host, if you dont have this limitation then other methods may be better
14
+
15
+
## The idea
16
+
The idea is as the following:
17
+
* Setup two different nginx servers on of them listens on ports 80,443 and the other on localhost:8080 and localhost:8443
18
+
* The server listening on localhost, serves a single static html file for every request and returns status 503 for every request
19
+
* We setup a pf table called `maintenance` which is initially empty
20
+
* We redirect any request from addresses found in `maintenance` towards ports 80 and 443 to our nginx listening on localhost at 8080 and 8443 respectively
21
+
* We allow the allow any remaining requests to access the nginx instance listening on our public interface
22
+
23
+
## Configuration
9
24
10
25
* Configure pf
11
26
```
@@ -14,40 +29,62 @@ pass in quick inet proto tcp from <maintenance> to port 80 rdr-to port 8080 labe
14
29
pass in quick inet proto tcp from <maintenance> to port 443 rdr-to port 8443 label "www-maintenance"
15
30
pass in quick inet proto tcp to port {80,443} label "www-normal"
0 commit comments