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
edx
configuration
Commits
b26f5288
Commit
b26f5288
authored
Jun 18, 2014
by
Feanil Patel
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #903 from mtyaka/nginx-x-forwarded-for
Nginx X-Forwarded-For header configuration.
parents
2b2035d4
28f0e029
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
36 additions
and
0 deletions
+36
-0
AUTHORS
+1
-0
playbooks/edx_sandbox.yml
+2
-0
playbooks/roles/nginx/defaults/main.yml
+9
-0
playbooks/roles/nginx/templates/edx/app/nginx/sites-available/cms.j2
+6
-0
playbooks/roles/nginx/templates/edx/app/nginx/sites-available/forum.j2
+6
-0
playbooks/roles/nginx/templates/edx/app/nginx/sites-available/lms-preview.j2
+6
-0
playbooks/roles/nginx/templates/edx/app/nginx/sites-available/lms.j2
+6
-0
No files found.
AUTHORS
View file @
b26f5288
...
...
@@ -31,3 +31,4 @@ Wang Peifeng <pku9104038@hotmail.com>
Ray Hooker <ray.hooker@gmail.com>
David Pollack <david@sologourmand.com>
Rodolphe Quiedeville <rodolphe@quiedeville.org>
Matjaz Gregoric <mtyaka@gmail.com>
playbooks/edx_sandbox.yml
View file @
b26f5288
...
...
@@ -13,6 +13,8 @@
openid_workaround
:
True
EDXAPP_LMS_NGINX_PORT
:
'
80'
edx_platform_version
:
'
master'
# Set to false if deployed behind another proxy/load balancer.
NGINX_SET_X_FORWARDED_HEADERS
:
True
# These should stay false for the public AMI
COMMON_ENABLE_DATADOG
:
False
COMMON_ENABLE_SPLUNKFORWARDER
:
False
...
...
playbooks/roles/nginx/defaults/main.yml
View file @
b26f5288
...
...
@@ -13,6 +13,15 @@ NGINX_ENABLE_SSL: False
NGINX_SSL_CERTIFICATE
:
'
ssl-cert-snakeoil.pem'
NGINX_SSL_KEY
:
'
ssl-cert-snakeoil.key'
# When set to False, nginx will pass X-Forwarded-For, X-Forwarded-Port,
# and X-Forwarded-Proto headers through to the backend unmodified.
# This is desired when nginx is deployed behind another load balancer
# which takes care of properly setting the X-Forwarded-* headers.
# When there is no other load balancer in front of nginx, set this
# variable to True to force nginx to set the values of the X-Forwarded-*
# headers to reflect the properties of the incoming request.
NGINX_SET_X_FORWARDED_HEADERS
:
False
nginx_app_dir
:
"
{{
COMMON_APP_DIR
}}/nginx"
nginx_data_dir
:
"
{{
COMMON_DATA_DIR
}}/nginx"
nginx_conf_dir
:
"
{{
nginx_app_dir
}}/conf.d"
...
...
playbooks/roles/nginx/templates/edx/app/nginx/sites-available/cms.j2
View file @
b26f5288
...
...
@@ -41,9 +41,15 @@ server {
location @proxy_to_cms_app {
{% if NGINX_SET_X_FORWARDED_HEADERS %}
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Port $server_port;
proxy_set_header X-Forwarded-For $remote_addr;
{% else %}
proxy_set_header X-Forwarded-Proto $http_x_forwarded_proto;
proxy_set_header X-Forwarded-Port $http_x_forwarded_port;
proxy_set_header X-Forwarded-For $http_x_forwarded_for;
{% endif %}
proxy_set_header Host $http_host;
proxy_redirect off;
...
...
playbooks/roles/nginx/templates/edx/app/nginx/sites-available/forum.j2
View file @
b26f5288
...
...
@@ -43,9 +43,15 @@ server {
{% include "robots.j2" %}
location @proxy_to_app {
{% if NGINX_SET_X_FORWARDED_HEADERS %}
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Port $server_port;
proxy_set_header X-Forwarded-For $remote_addr;
{% else %}
proxy_set_header X-Forwarded-Proto $http_x_forwarded_proto;
proxy_set_header X-Forwarded-Port $http_x_forwarded_port;
proxy_set_header X-Forwarded-For $http_x_forwarded_for;
{% endif %}
proxy_set_header Host $http_host;
proxy_redirect off;
...
...
playbooks/roles/nginx/templates/edx/app/nginx/sites-available/lms-preview.j2
View file @
b26f5288
...
...
@@ -21,9 +21,15 @@ server {
rewrite ^(.*)/favicon.ico$ /static/images/favicon.ico last;
location @proxy_to_lms-preview_app {
{% if NGINX_SET_X_FORWARDED_HEADERS %}
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Port $server_port;
proxy_set_header X-Forwarded-For $remote_addr;
{% else %}
proxy_set_header X-Forwarded-Proto $http_x_forwarded_proto;
proxy_set_header X-Forwarded-Port $http_x_forwarded_port;
proxy_set_header X-Forwarded-For $http_x_forwarded_for;
{% endif %}
proxy_set_header Host $http_host;
proxy_redirect off;
...
...
playbooks/roles/nginx/templates/edx/app/nginx/sites-available/lms.j2
View file @
b26f5288
...
...
@@ -38,9 +38,15 @@ server {
rewrite ^(.*)/favicon.ico$ /static/images/favicon.ico last;
location @proxy_to_lms_app {
{% if NGINX_SET_X_FORWARDED_HEADERS %}
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Port $server_port;
proxy_set_header X-Forwarded-For $remote_addr;
{% else %}
proxy_set_header X-Forwarded-Proto $http_x_forwarded_proto;
proxy_set_header X-Forwarded-Port $http_x_forwarded_port;
proxy_set_header X-Forwarded-For $http_x_forwarded_for;
{% endif %}
proxy_set_header Host $http_host;
proxy_redirect off;
...
...
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