Skip to content

Commit

Permalink
fix: handle password reset dynamic url redirection in prospectus
Browse files Browse the repository at this point in the history
  • Loading branch information
syedsajjadkazmii committed Jun 25, 2024
1 parent 24376a9 commit bddefe0
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 bddefe0

Please sign in to comment.