Commit 6f549fe6 by Kevin Falcone

Merge pull request #2898 from smaeda-ks/s.maeda/replace-nginx-rewrite-to-return

Replace nginx redirect method from rewrite to return for speeding up
parents 15b3b416 b9c57a21
...@@ -52,3 +52,4 @@ Dan Powell <dan@abakas.com> ...@@ -52,3 +52,4 @@ Dan Powell <dan@abakas.com>
Omar Al-Ithawi <oithawi@qrf.org> Omar Al-Ithawi <oithawi@qrf.org>
David Adams<dcadams@stanford.edu> David Adams<dcadams@stanford.edu>
Florian Haas <florian@hastexo.com> Florian Haas <florian@hastexo.com>
Shohei Maeda <s.maeda@gacco.co.jp>
...@@ -29,7 +29,7 @@ server { ...@@ -29,7 +29,7 @@ server {
# Execute the actual redirect # Execute the actual redirect
if ($do_redirect_to_https = "true") if ($do_redirect_to_https = "true")
{ {
rewrite ^ https://$host$request_uri? permanent; return 301 https://$host$request_uri;
} }
{% endif %} {% endif %}
......
...@@ -64,7 +64,7 @@ error_page {{ k }} {{ v }}; ...@@ -64,7 +64,7 @@ error_page {{ k }} {{ v }};
# Execute the actual redirect # Execute the actual redirect
if ($do_redirect_to_https = "true") if ($do_redirect_to_https = "true")
{ {
rewrite ^ https://$host$request_uri? permanent; return 301 https://$host$request_uri;
} }
{% endif %} {% endif %}
......
...@@ -80,7 +80,7 @@ location @proxy_to_app { ...@@ -80,7 +80,7 @@ location @proxy_to_app {
# Execute the actual redirect # Execute the actual redirect
if ($do_redirect_to_https = "true") if ($do_redirect_to_https = "true")
{ {
rewrite ^ https://$host$request_uri? permanent; return 301 https://$host$request_uri;
} }
{% endif %} {% endif %}
} }
...@@ -50,7 +50,7 @@ server { ...@@ -50,7 +50,7 @@ server {
# Execute the actual redirect # Execute the actual redirect
if ($do_redirect_to_https = "true") if ($do_redirect_to_https = "true")
{ {
rewrite ^ https://$host$request_uri? permanent; return 301 https://$host$request_uri;
} }
{% endif %} {% endif %}
......
...@@ -29,7 +29,7 @@ server { ...@@ -29,7 +29,7 @@ server {
# Execute the actual redirect # Execute the actual redirect
if ($do_redirect_to_https = "true") if ($do_redirect_to_https = "true")
{ {
rewrite ^ https://$host$request_uri? permanent; return 301 https://$host$request_uri;
} }
{% endif %} {% endif %}
......
...@@ -55,7 +55,7 @@ location @proxy_to_app { ...@@ -55,7 +55,7 @@ location @proxy_to_app {
# Execute the actual redirect # Execute the actual redirect
if ($do_redirect_to_https = "true") if ($do_redirect_to_https = "true")
{ {
rewrite ^ https://$host$request_uri? permanent; return 301 https://$host$request_uri;
} }
{% endif %} {% endif %}
} }
...@@ -45,7 +45,7 @@ server { ...@@ -45,7 +45,7 @@ server {
# Execute the actual redirect # Execute the actual redirect
if ($do_redirect_to_https = "true") if ($do_redirect_to_https = "true")
{ {
rewrite ^ https://$host$request_uri? permanent; return 301 https://$host$request_uri;
} }
{% endif %} {% endif %}
......
...@@ -98,7 +98,7 @@ server { ...@@ -98,7 +98,7 @@ server {
# Execute the actual redirect # Execute the actual redirect
if ($do_redirect_to_https = "true") if ($do_redirect_to_https = "true")
{ {
rewrite ^ https://$host$request_uri? permanent; return 301 https://$host$request_uri;
} }
{% endif %} {% endif %}
......
...@@ -84,7 +84,7 @@ error_page {{ k }} {{ v }}; ...@@ -84,7 +84,7 @@ error_page {{ k }} {{ v }};
# Execute the actual redirect # Execute the actual redirect
if ($do_redirect_to_https = "true") if ($do_redirect_to_https = "true")
{ {
rewrite ^ https://$host$request_uri? permanent; return 301 https://$host$request_uri;
} }
{% endif %} {% endif %}
...@@ -118,7 +118,7 @@ error_page {{ k }} {{ v }}; ...@@ -118,7 +118,7 @@ error_page {{ k }} {{ v }};
{% include "basic-auth.j2" %} {% include "basic-auth.j2" %}
{% if NGINX_EDXAPP_EMBARGO_CIDRS -%} {% if NGINX_EDXAPP_EMBARGO_CIDRS -%}
if ( $embargo ) { if ( $embargo ) {
rewrite ^ /embargo; return 302 /embargo;
} }
{% endif -%} {% endif -%}
try_files $uri @proxy_to_lms_app; try_files $uri @proxy_to_lms_app;
......
...@@ -53,7 +53,7 @@ server { ...@@ -53,7 +53,7 @@ server {
# Execute the actual redirect # Execute the actual redirect
if ($do_redirect_to_https = "true") if ($do_redirect_to_https = "true")
{ {
rewrite ^ https://$host$request_uri? permanent; return 301 https://$host$request_uri;
} }
{% endif %} {% endif %}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment