-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheasy-maintenance-mode-with-nginx-2d4d510a0980.html
194 lines (142 loc) · 6.52 KB
/
easy-maintenance-mode-with-nginx-2d4d510a0980.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="HandheldFriendly" content="True" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="robots" content="" />
<link href="https://fonts.googleapis.com/css2?family=Source+Code+Pro:ital,wght@0,400;0,700;1,400&family=Source+Sans+Pro:ital,wght@0,300;0,400;0,700;1,400&display=swap" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="./theme/stylesheet/style.min.css">
<link id="pygments-light-theme" rel="stylesheet" type="text/css"
href="./theme/pygments/github.min.css">
<link rel="stylesheet" type="text/css" href="./theme/font-awesome/css/fontawesome.css">
<link rel="stylesheet" type="text/css" href="./theme/font-awesome/css/brands.css">
<link rel="stylesheet" type="text/css" href="./theme/font-awesome/css/solid.css">
<link href="https://shanedowling.com/feeds/all.atom.xml" type="application/atom+xml" rel="alternate" title="Shane Dowling Atom">
<link href="https://shanedowling.com/feeds/all.rss.xml" type="application/rss+xml" rel="alternate" title="Shane Dowling RSS">
<script type="text/javascript">
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'G-Z9P3V6D0SV', 'auto');
ga('send', 'pageview');
</script>
<meta name="author" content="Shane Dowling" />
<meta name="description" content="So I combined a few solutions I found online to come up with a quick way to set up maintenance mode using nginx. Ideally it shouldn't happen but in times of emergency in can be good to knock up a quick maintenance page for everyone but your own internal ips …" />
<meta name="keywords" content="">
<meta property="og:site_name" content="Shane Dowling"/>
<meta property="og:title" content="Easy maintenance mode with nginx"/>
<meta property="og:description" content="So I combined a few solutions I found online to come up with a quick way to set up maintenance mode using nginx. Ideally it shouldn't happen but in times of emergency in can be good to knock up a quick maintenance page for everyone but your own internal ips …"/>
<meta property="og:locale" content="en_US"/>
<meta property="og:url" content="./easy-maintenance-mode-with-nginx-2d4d510a0980.html"/>
<meta property="og:type" content="article"/>
<meta property="article:published_time" content="2018-08-20 18:51:42.074000+00:00"/>
<meta property="article:modified_time" content=""/>
<meta property="article:author" content="./author/shane-dowling.html">
<meta property="article:section" content="Tech"/>
<meta property="og:image" content="/images/logo.png">
<title>Shane Dowling – Easy maintenance mode with nginx</title>
</head>
<body class="light-theme">
<aside>
<div>
<a href="./">
<img src="/images/logo.png" alt="Shane Dowling" title="Shane Dowling">
</a>
<h1>
<a href="./">Shane Dowling</a>
</h1>
<p>Platform Engineering Manager</p>
<nav>
<ul class="list">
<li>
<a target="_self"
href="./pages/contact.html#contact">
Contact
</a>
</li>
<li>
<a target="_self"
href="./pages/now-page.html#now-page">
Now Page
</a>
</li>
<li>
<a target="_self"
href="./pages/statuslog.html#statuslog">
Statuslog
</a>
</li>
<li>
<a target="_self" href="https://hybridcloudshow.com/" >podcast</a>
</li>
<li>
<a target="_self" href="https://pemonthly.com/" >newsletter</a>
</li>
</ul>
</nav>
<ul class="social">
<li>
<a class="sc-github"
href="http://github.com/shano"
target="_blank">
<i class="fa-brands fa-github"></i>
</a>
</li>
<li>
<a class="sc-mastodon"
rel="me" href="http://social.lol/@sed"
target="_blank">
<i class="fa-brands fa-mastodon"></i>
</a>
</li>
<li>
<a class="sc-linkedin"
href="https://www.linkedin.com/in/shanedow/"
target="_blank">
<i class="fa-brands fa-linkedin"></i>
</a>
</li>
</ul>
</div>
</aside>
<main>
<article class="single">
<header>
<h1 id="easy-maintenance-mode-with-nginx-2d4d510a0980">Easy maintenance mode with nginx</h1>
<p>
Posted on Mon 20 August 2018 in <a href="./category/tech.html">Tech</a>
</p>
</header>
<div>
<p>So I combined a few solutions I found online to come up with a quick way to set up maintenance mode using nginx. Ideally it shouldn't happen but in times of emergency in can be good to knock up a quick maintenance page for everyone but your own internal ips.</p>
<h3>Nginx Config</h3>
<p>So here's the configuration I use for nginx, it starts with setting the internal ips of your company in the main nginx config file. Then in the actual vhost, you can set it to watch for the existence of a maintenance_on.html and when it exists, throw a 503 and use the maintenance page as your 503 error page.</p>
<h3>How to use</h3>
<p>By default I have the file named as maintenance_off.html, so it's only a simple move operation to turn on maintenance mode. For the content of my maintenance file, I generally use this self-contained static html file to serve out a message to customers.</p>
<p><strong>Note</strong>: Any sort of conditionals going on on your web server is likely to slow things down by a few milliseconds. Again you're asking your web server to check against network and the disk per request, then make a decision, so bear this in mind before implementing a solution like this.</p>
</div>
<div class="tag-cloud">
<p>
</p>
</div>
</article>
<footer>
<p>© </p>
<p>
Built with <a href="http://getpelican.com" target="_blank">Pelican</a> using <a href="http://bit.ly/flex-pelican" target="_blank">Flex</a> theme
</p></footer> </main>
<script type="application/ld+json">
{
"@context" : "http://schema.org",
"@type" : "Blog",
"name": " Shane Dowling ",
"url" : ".",
"image": "/images/logo.png",
"description": ""
}
</script>
</body>
</html>