Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
configuration
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
configuration
Commits
aff50364
Commit
aff50364
authored
Sep 18, 2014
by
John Jarvis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
adding server-status pages
parent
5a58b255
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
82 additions
and
0 deletions
+82
-0
playbooks/roles/nginx/defaults/main.yml
+16
-0
playbooks/roles/nginx/tasks/main.yml
+11
-0
playbooks/roles/nginx/templates/edx/app/nginx/sites-available/cms.j2
+3
-0
playbooks/roles/nginx/templates/edx/app/nginx/sites-available/lms.j2
+4
-0
playbooks/roles/nginx/templates/edx/app/nginx/sites-available/static-files.j2
+6
-0
playbooks/roles/nginx/templates/edx/var/nginx/server-static/server-template.j2
+42
-0
No files found.
playbooks/roles/nginx/defaults/main.yml
View file @
aff50364
...
...
@@ -33,8 +33,24 @@ NGINX_LOG_FORMAT_NAME: 'p_combined'
# headers to reflect the properties of the incoming request.
NGINX_SET_X_FORWARDED_HEADERS
:
False
NGINX_SERVER_HTML_FILES
:
-
file
:
rate-limit.html
title
:
'
Rate
limit
exceeded'
msg
:
'
If
think
you
have
encountered
this
message
in
error
please
let
us
know
at
<a
href="mailto:{{
EDXAPP_TECH_SUPPORT_EMAIL|default("technical@example.com")
}}">{{
EDXAPP_TECH_SUPPORT_EMAIL|default("technical@example.com")
}}</a>'
img
:
'
https://files.edx.org/images-public/edx-sad-small.png'
heading
:
'
Uh
oh,
we
are
having
some
server
issues..'
-
file
:
server-error.html
title
:
'
Server
error'
msg
:
'
If
think
you
have
encountered
this
message
in
error
please
let
us
know
at
<a
href="mailto:{{
EDXAPP_TECH_SUPPORT_EMAIL|default("technical@example.com")
}}">{{
EDXAPP_TECH_SUPPORT_EMAIL|default("technical@example.com")
}}</a>'
img
:
'
https://files.edx.org/images-public/edx-sad-small.png'
heading
:
'
Uh
oh,
we
are
having
some
server
issues..'
nginx_app_dir
:
"
{{
COMMON_APP_DIR
}}/nginx"
nginx_data_dir
:
"
{{
COMMON_DATA_DIR
}}/nginx"
nginx_server_static_dir
:
"
{{
nginx_data_dir
}}/server-static"
nginx_conf_dir
:
"
{{
nginx_app_dir
}}/conf.d"
nginx_log_dir
:
"
{{
COMMON_LOG_DIR
}}/nginx"
nginx_sites_available_dir
:
"
{{
nginx_app_dir
}}/sites-available"
...
...
playbooks/roles/nginx/tasks/main.yml
View file @
aff50364
...
...
@@ -24,6 +24,7 @@
with_items
:
-
"
{{
nginx_data_dir
}}"
-
"
{{
nginx_log_dir
}}"
-
"
{{
nginx_server_static_dir
}}"
notify
:
restart nginx
-
name
:
Install nginx packages
...
...
@@ -113,6 +114,16 @@
notify
:
reload nginx
with_dict
:
nginx_redirects
# These are static pages that can be used
# for nginx rate limiting, 500 errors, etc.
-
name
:
Create NGINX server templates
template
:
>
src=edx/var/nginx/server-static/server-template.j2
dest={{ nginx_server_static_dir }}/{{ item.file }}
owner=root group={{ common_web_user }} mode=0640
with_items
:
NGINX_SERVER_HTML_FILES
-
name
:
Write out htpasswd file
htpasswd
:
>
name={{ COMMON_HTPASSWD_USER }}
...
...
playbooks/roles/nginx/templates/edx/app/nginx/sites-available/cms.j2
View file @
aff50364
...
...
@@ -13,6 +13,9 @@ upstream cms-backend {
server {
# CMS configuration file for nginx, templated by ansible
# 500 error pages
error_page 500 502 504 /server/server-error.html;
{% if NGINX_ENABLE_SSL %}
listen {{EDXAPP_CMS_NGINX_PORT}} {{default_site}};
...
...
playbooks/roles/nginx/templates/edx/app/nginx/sites-available/lms.j2
View file @
aff50364
...
...
@@ -18,6 +18,9 @@ limit_req_zone $cookie_{{ EDXAPP_SESSION_COOKIE_NAME }} zone=cookies:10m rate={{
server {
# LMS configuration file for nginx, templated by ansible
# 500 error pages
error_page 500 502 504 /server/server-error.html;
{% if NGINX_ENABLE_SSL %}
listen {{EDXAPP_LMS_NGINX_PORT}} {{default_site}};
...
...
@@ -77,6 +80,7 @@ server {
{%- if EDXAPP_ENABLE_RATE_LIMITING -%}
# Set Limit
limit_req zone=cookies burst={{ EDXAPP_COURSE_REQUEST_BURST_RATE }};
error_page 503 = /server/rate-limit.html;
{%- endif -%}
{%- include "basic-auth.j2" %}
...
...
playbooks/roles/nginx/templates/edx/app/nginx/sites-available/static-files.j2
View file @
aff50364
# static pages for server status
location ~ ^/server/(?P<file>.*) {
root /edx/var/nginx/server-static;
try_files /$file =404;
}
location ~ ^/static/(?P<file>.*) {
root {{ edxapp_data_dir }};
try_files /staticfiles/$file /course_static/$file =404;
...
...
playbooks/roles/nginx/templates/edx/var/nginx/server-static/server-template.j2
0 → 100644
View file @
aff50364
<!DOCTYPE html>
<head>
<meta
charset=
"utf-8"
>
<meta
http-equiv=
"X-UA-Compatible"
content=
"IE=edge,chrome=1"
>
<title>
{{ item.title }}
</title>
<meta
name=
"description"
content=
""
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1"
>
<style
media=
"screen"
type=
"text/css"
>
h1
,
h2
{
font-family
:
"Helvetica Neue"
,
Helvetica
,
Roboto
,
Arial
,
sans-serif
;
margin-bottom
:
.3em
;
font-size
:
2.0em
;
line-height
:
1.25em
;
text-rendering
:
optimizeLegibility
;
font-weight
:
bold
;
color
:
#000000
;
}
h2
{
font-size
:
1.8em
;
color
:
#5b5e63
;
}
p
{
font-family
:
Georgia
,
Cambria
,
"Times New Roman"
,
Times
,
serif
;
margin
:
auto
;
margin-bottom
:
1em
;
font-weight
:
200
;
line-height
:
1.4em
;
font-size
:
1.1em
;
max-width
:
80%
;
}
</style>
</head>
<body>
<div
style=
"margin: auto; width: 800px; text-align: center; padding:20px 0px 0px 0px;"
>
<h1>
{{ item.heading }}
</h1>
<img
src=
"{{ item.img}}"
alt=
""
>
<h2>
{{ item.title }}
</h2>
<p>
{{ item.msg }}
</div
</body
>
</html>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment