Skip to content

Commit

Permalink
Merge pull request #47 from edx/sajjad/VAN-1966/handle-password-reset…
Browse files Browse the repository at this point in the history
…-dynamic-url-prospectus

fix: handle password reset dynamic url redirection in prospectus
  • Loading branch information
syedsajjadkazmii authored Jun 25, 2024
2 parents 24376a9 + bddefe0 commit cf7f59f
Showing 1 changed file with 16 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ server {
proxy_pass_request_headers off;
{% endif %}
}

# favicon is requested a lot. cache it at the edge.

location /favicon.ico {
Expand Down Expand Up @@ -176,6 +176,21 @@ server {
{% endif %}
}

location /password_reset_confirm/ {
{% if PROSPECTUS_S3_HOSTING_PROXY_ENABLED %}
rewrite ^ /{{ PROSPECTUS_S3_HOSTING_PREFIX }}/password_reset_confirm/index.html break;
proxy_pass {{ PROSPECTUS_S3_HOSTING_BUCKET_URL }}/{{ PROSPECTUS_S3_HOSTING_PREFIX }}/password_reset_confirm/index.html;
# Hide client headers from S3 to prevent request headers too big error
proxy_pass_request_headers off;
# proxy_redirect ensures redirects from s3 are rewritten
# For example it will fix a redirect from s3 to prevent /school/mitx from trying to redirect to /924c142-1/school/mitx/
# The second parameter being " " is to prevent nginx sticking http://hostname in front of the location directive
proxy_redirect "/{{ PROSPECTUS_S3_HOSTING_PREFIX }}" " ";
{% else %}
try_files $uri $uri/ /password_reset_confirm/index.html;
{% endif %}
}

# preview pages are not cached, and have basic auth

location /secure-preview/ {
Expand Down

0 comments on commit cf7f59f

Please sign in to comment.