Skip to content

Commit

Permalink
Fix insecure asset loading with web proxy enabled
Browse files Browse the repository at this point in the history
This issue is well described in this post:
https://discuss.overhang.io/t/reverse-proxy-and-mixed-content-issue/86

When WEB_PROXY=True and ACTIVATE_HTTPS=True the containerized nginx sets
an incorrect value for X-Forwarded-Proto.
  • Loading branch information
regisb committed Jul 7, 2019
1 parent eb91030 commit c431fb8
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Note: Breaking changes between versions are indicated by "💥".


## Latest ## Latest


- [Bugfix] Fix insecure static asset loading when web proxy is enabled
- [Improvement] Rename ``SECRET_KEY`` configuration parameter to ``OPENEDX_SECRET_KEY`` - [Improvement] Rename ``SECRET_KEY`` configuration parameter to ``OPENEDX_SECRET_KEY``
- [Improvement] Add support for TLS in external SMTP server (#231) - [Improvement] Add support for TLS in external SMTP server (#231)
- [Bugfix] Fix missing video transcripts in LMS (#229) - [Bugfix] Fix missing video transcripts in LMS (#229)
Expand Down
2 changes: 1 addition & 1 deletion plugins/minio/setup.py
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@


setup( setup(
name="tutor-minio", name="tutor-minio",
version="0.0.2", version="0.0.3",
url="https://docs.tutor.overhang.io/", url="https://docs.tutor.overhang.io/",
project_urls={ project_urls={
"Documentation": "https://docs.tutor.overhang.io/", "Documentation": "https://docs.tutor.overhang.io/",
Expand Down
2 changes: 2 additions & 0 deletions plugins/minio/tutorminio/patches/nginx-extra
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -24,9 +24,11 @@ server {
client_max_body_size 0; client_max_body_size 0;


location / { location / {
{% if not WEB_PROXY %}
proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Port $server_port; proxy_set_header X-Forwarded-Port $server_port;
proxy_set_header X-Forwarded-For $remote_addr; proxy_set_header X-Forwarded-For $remote_addr;
{% endif %}
proxy_set_header Host $http_host; proxy_set_header Host $http_host;
proxy_redirect off; proxy_redirect off;


Expand Down
2 changes: 1 addition & 1 deletion plugins/notes/setup.py
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@


setup( setup(
name="tutor-notes", name="tutor-notes",
version="0.0.1", version="0.0.2",
url="https://docs.tutor.overhang.io/", url="https://docs.tutor.overhang.io/",
project_urls={ project_urls={
"Documentation": "https://docs.tutor.overhang.io/", "Documentation": "https://docs.tutor.overhang.io/",
Expand Down
2 changes: 2 additions & 0 deletions plugins/notes/tutornotes/patches/nginx-extra
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -24,9 +24,11 @@ server {
server_tokens off; server_tokens off;


location / { location / {
{% if not WEB_PROXY %}
proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Port $server_port; proxy_set_header X-Forwarded-Port $server_port;
proxy_set_header X-Forwarded-For $remote_addr; proxy_set_header X-Forwarded-For $remote_addr;
{% endif %}
proxy_set_header Host $http_host; proxy_set_header Host $http_host;
proxy_redirect off; proxy_redirect off;


Expand Down
2 changes: 2 additions & 0 deletions tutor/templates/apps/nginx/cms.conf
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -26,9 +26,11 @@ server {
rewrite ^(.*)/favicon.ico$ /static/images/favicon.ico last; rewrite ^(.*)/favicon.ico$ /static/images/favicon.ico last;


location @proxy_to_cms_app { location @proxy_to_cms_app {
{% if not WEB_PROXY %}
proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Port $server_port; proxy_set_header X-Forwarded-Port $server_port;
proxy_set_header X-Forwarded-For $remote_addr; proxy_set_header X-Forwarded-For $remote_addr;
{% endif %}
proxy_set_header Host $http_host; proxy_set_header Host $http_host;
proxy_redirect off; proxy_redirect off;


Expand Down
2 changes: 2 additions & 0 deletions tutor/templates/apps/nginx/lms.conf
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -26,9 +26,11 @@ server {
rewrite ^(.*)/favicon.ico$ /static/images/favicon.ico last; rewrite ^(.*)/favicon.ico$ /static/images/favicon.ico last;


location @proxy_to_lms_app { location @proxy_to_lms_app {
{% if not WEB_PROXY %}
proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Port $server_port; proxy_set_header X-Forwarded-Port $server_port;
proxy_set_header X-Forwarded-For $remote_addr; proxy_set_header X-Forwarded-For $remote_addr;
{% endif %}
proxy_set_header Host $http_host; proxy_set_header Host $http_host;
proxy_redirect off; proxy_redirect off;


Expand Down

0 comments on commit c431fb8

Please sign in to comment.