Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SSR-1] Removal of Rendertron #474

Merged
merged 1 commit into from
Mar 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

This file was deleted.

5 changes: 0 additions & 5 deletions deployment/k3s/templates/networking/ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,6 @@ spec:
services:
- name: cdn-svc
port: 8000
- kind: Rule
match: Host(`{{ $.Values.url }}`) && PathPrefix(`/rendertron/`)
services:
- name: rendertron-svc
port: 9100
middlewares:
- name: stripprefix
- kind: Rule
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,4 @@ metadata:
spec:
stripPrefix:
prefixes:
- /rendertron
- /maps
18 changes: 0 additions & 18 deletions deployment/k3s/templates/networking/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -108,21 +108,3 @@ spec:
- name: webclient
port: 9000
targetPort: 80
---
apiVersion: v1
kind: Service
metadata:
name: rendertron-svc
labels:
app: navigatum
deployment: rendertron
namespace: {{ $.Values.namespace }}
spec:
type: ClusterIP
selector:
app: navigatum
deployment: rendertron
ports:
- name: rendertron
port: 9100
targetPort: 3000
41 changes: 0 additions & 41 deletions webclient/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -44,31 +44,6 @@ http {
"de" "de";
}

# bot without js-execution workaround
# see https://github.com/GoogleChrome/rendertron/blob/main/middleware/src/middleware.ts#L24-L41
map $http_user_agent $no_js_exec {
default 0;
'~*Baiduspider' 1;
'~*bingbot' 1;
'~*Embedly' 1;
'~*facebookexternalhit' 1;
'~*LinkedInBot' 1;
'~*outbrain' 1;
'~*pinterest' 1;
'~*quora link preview' 1;
'~*rogerbot' 1;
'~*showyoubot' 1;
'~*Slackbot' 1;
'~*TelegramBot' 1;
'~*Twitterbot' 1;
'~*vkShare' 1;
'~*W3C_Validator' 1;
'~*WhatsApp' 1;
'~*Discordbot' 1;
'~*googlebot' 1;
'~*SemrushBot' 1;
}

server {
# default_server makes nginx not care about HOST, we hande this upstream by Traefik
listen 80 default_server;
Expand Down Expand Up @@ -97,22 +72,6 @@ http {
return 200 'healthy';
}

if ($no_js_exec = 1) {
rewrite ^/(((api|search|about|view|campus|site|building|room)/?.*)?)$ /rendertron/$1;
}
# equivalent to:
#if ($uri ~ ^/((\.well-known|assets)/.*|(robots.txt|googlebef9161f1176c5e0.html|adds.txt|app-ads.txt|favicon.ico|health|404.html|50x.html))$){
# set $no_js_exec 0;
#}

#render all pages, that could execute js via rendertron
location ^~ /rendertron/ {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header User-Agent 'Rendertron';
proxy_pass https://rendertron.navigatum-scv.svc.cluster.local/rendertron/render/https://nav.tum.de$request_uri;
}

location / {
add_header Cache-Control no-cache; # disable caching, as we do not want to have theme/language related issues
expires 360s; # 360s=5min
Expand Down