redirects for edu and canvas for .org

do2
Matthew 2025-03-20 18:03:40 -04:00
parent 036ecb5689
commit dd97c840b6
Signed by: matthew
SSH Key Fingerprint: SHA256:piIXekA9q1p0ZGi4ogFbNY1embip5Ytbi3v8AZ8UYq4
2 changed files with 49 additions and 35 deletions

View File

@ -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";
}
}

View File

@ -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";
}
}