From 1bca31a1268a6b3f32c968ffea8063cd8108be6c Mon Sep 17 00:00:00 2001 From: adarshm11 Date: Sun, 14 Dec 2025 19:05:09 -0800 Subject: [PATCH 1/4] adarsh --- docker-compose.yml | 1 + nginx.conf | 14 ++++++++++++++ 2 files changed, 15 insertions(+) diff --git a/docker-compose.yml b/docker-compose.yml index f9a0395bc..b485aa274 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -114,6 +114,7 @@ services: - ./sce_sjsu_edu_cert.cer:/etc/nginx/sce_sjsu_edu_cert.cer - ./sce.key:/etc/nginx/sce.key - nginx_cache:/var/cache/nginx + - ./interview/costco_gas.json:/var/www/html/data/costco_gas.json:ro command: [nginx-debug, '-g', 'daemon off;'] ports: - '80:80' diff --git a/nginx.conf b/nginx.conf index 4d6738a51..2325a9d51 100644 --- a/nginx.conf +++ b/nginx.conf @@ -131,6 +131,20 @@ http { proxy_ssl_server_name on; proxy_ssl_protocols TLSv1.2 TLSv1.3; } + + location ~ ^/gas/?$ { + root /var/www/html/data/; + + try_files /costco_gas.json @fallback_oops; + + default_type application/json; + add_header Access-Control-Allow-Origin *; + } + + location @fallback_oops { + default_type text/plain; + return 404 "oops! we couldnt load your interview question lol, i guess this ones free!"; + } } } From 8ab9faa65ac439c1a431bbdbd5fe60926379c1da Mon Sep 17 00:00:00 2001 From: evan Date: Sun, 14 Dec 2025 20:35:20 -0800 Subject: [PATCH 2/4] ignore --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index a6307a3d5..254f525af 100644 --- a/.gitignore +++ b/.gitignore @@ -105,3 +105,5 @@ token.json api/main_endpoints/routes/printing/* !api/main_endpoints/routes/printing/keep + +interview/*.json From 2ee09432d0c137212561e07d39481b2dd8fc78e8 Mon Sep 17 00:00:00 2001 From: evan Date: Sun, 14 Dec 2025 20:38:59 -0800 Subject: [PATCH 3/4] idk wat im doing --- nginx.conf | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/nginx.conf b/nginx.conf index 2325a9d51..5c329b459 100644 --- a/nginx.conf +++ b/nginx.conf @@ -107,13 +107,6 @@ http { proxy_pass http://compass-app:3000; } - #Load balancer - location /api { - proxy_pass http://mainendpoints; - } - location / { - proxy_pass http://webserver; - } location ~ ^/isbn/([0-9Xx-]+)$ { set $isbn_number $1; @@ -145,6 +138,14 @@ http { default_type text/plain; return 404 "oops! we couldnt load your interview question lol, i guess this ones free!"; } + + #Load balancer + location /api { + proxy_pass http://mainendpoints; + } + location / { + proxy_pass http://webserver; + } } } From c822c0d562597c8f6a074c0d0acee4ab2d8bdfb9 Mon Sep 17 00:00:00 2001 From: evan Date: Sun, 14 Dec 2025 20:41:44 -0800 Subject: [PATCH 4/4] cant step on history --- nginx.conf | 40 +++++++++++++++++----------------------- 1 file changed, 17 insertions(+), 23 deletions(-) diff --git a/nginx.conf b/nginx.conf index 5c329b459..1a944f946 100644 --- a/nginx.conf +++ b/nginx.conf @@ -102,29 +102,6 @@ http { return 302 $scheme://$http_host/status/$is_args$args; } - location ~ ^/spartan-compass(/.*)? { - proxy_set_header Host $http_host; - proxy_pass http://compass-app:3000; - } - - location ~ ^/isbn/([0-9Xx-]+)$ { - set $isbn_number $1; - - resolver 8.8.8.8 valid=30s; - - proxy_set_header Host openlibrary.org; - - proxy_hide_header Access-Control-Allow-Origin; - add_header Access-Control-Allow-Origin *; - - - proxy_pass https://openlibrary.org/isbn/$isbn_number.json; - - - proxy_ssl_server_name on; - proxy_ssl_protocols TLSv1.2 TLSv1.3; - } - location ~ ^/gas/?$ { root /var/www/html/data/; @@ -146,6 +123,23 @@ http { location / { proxy_pass http://webserver; } + location ~ ^/isbn/([0-9Xx-]+)$ { + set $isbn_number $1; + + resolver 8.8.8.8 valid=30s; + + proxy_set_header Host openlibrary.org; + + proxy_hide_header Access-Control-Allow-Origin; + add_header Access-Control-Allow-Origin *; + + + proxy_pass https://openlibrary.org/isbn/$isbn_number.json; + + + proxy_ssl_server_name on; + proxy_ssl_protocols TLSv1.2 TLSv1.3; + } } }