From dd97c840b63650b2808f97fa94be54711b921296 Mon Sep 17 00:00:00 2001 From: Matthew Date: Thu, 20 Mar 2025 18:03:40 -0400 Subject: [PATCH] redirects for edu and canvas for .org --- .../canvas.libraryofcode.dev.conf | 36 +------------- .../canvas.libraryofcode.org.conf | 48 +++++++++++++++++++ 2 files changed, 49 insertions(+), 35 deletions(-) create mode 100644 Nginx/Server Blocks/canvas.libraryofcode.org.conf diff --git a/Nginx/Server Blocks/canvas.libraryofcode.dev.conf b/Nginx/Server Blocks/canvas.libraryofcode.dev.conf index 9d5c1a9..7d7c13a 100644 --- a/Nginx/Server Blocks/canvas.libraryofcode.dev.conf +++ b/Nginx/Server Blocks/canvas.libraryofcode.dev.conf @@ -9,40 +9,6 @@ server { root /opt/canvas/public; index index.html; - passenger_enabled on; - passenger_app_env production; - passenger_ruby /usr/local/bin/ruby; - passenger_user canvas; - passenger_group root; - passenger_friendly_error_pages on; - # passenger_root /usr/lib/ruby/vendor_ruby/phusion_passenger/locations.ini; + return 307 https://canvas.libraryofcode.org$request_uri; - #passenger_pool_idle_time 300; - #passenger_max_pool_size 10; - - client_max_body_size 50M; - - - location / { - try_files $uri @app; - } - - location @app { - passenger_enabled on; - } - - location /assets/ { - expires max; - add_header Cache-Control public; - } - - location ~* \.(?:ico|css|js|gif|jpe?g|png|woff2?|eot|ttf|svg|otf)$ { - expires max; - add_header Cache-Control public; - } - - location /health_check { - access_log off; - return 200 "OK\n"; - } } diff --git a/Nginx/Server Blocks/canvas.libraryofcode.org.conf b/Nginx/Server Blocks/canvas.libraryofcode.org.conf new file mode 100644 index 0000000..516b19c --- /dev/null +++ b/Nginx/Server Blocks/canvas.libraryofcode.org.conf @@ -0,0 +1,48 @@ +server { + listen 443 ssl http2; + listen [::]:443 ssl http2; + server_name canvas.libraryofcode.org; + + ssl_certificate /etc/letsencrypt/live/libraryofcode.org/fullchain.pem; + ssl_certificate_key /etc/letsencrypt/live/libraryofcode.org/privkey.pem; + + root /opt/canvas/public; + index index.html; + + passenger_enabled on; + passenger_app_env production; + passenger_ruby /usr/local/bin/ruby; + passenger_user canvas; + passenger_group root; + passenger_friendly_error_pages on; + # passenger_root /usr/lib/ruby/vendor_ruby/phusion_passenger/locations.ini; + + #passenger_pool_idle_time 300; + #passenger_max_pool_size 10; + + client_max_body_size 50M; + + + location / { + try_files $uri @app; + } + + location @app { + passenger_enabled on; + } + + location /assets/ { + expires max; + add_header Cache-Control public; + } + + location ~* \.(?:ico|css|js|gif|jpe?g|png|woff2?|eot|ttf|svg|otf)$ { + expires max; + add_header Cache-Control public; + } + + location /health_check { + access_log off; + return 200 "OK\n"; + } +}