136 lines
4.5 KiB
Plaintext
136 lines
4.5 KiB
Plaintext
upstream KnowledgeServer {
|
|
server rss-svc.knowledge-shared:3010;
|
|
}
|
|
|
|
# upstream RSSServer {
|
|
# server rss-server.knowledge-shared:3010;
|
|
# }
|
|
|
|
# upstream ArgoworkflowsSever {
|
|
# server argoworkflows-svc.knowledge-shared:2746;
|
|
# }
|
|
|
|
server {
|
|
listen 80 default_server;
|
|
|
|
|
|
# Gzip Settings
|
|
gzip off;
|
|
gzip_disable "msie6";
|
|
gzip_min_length 1k;
|
|
gzip_buffers 16 64k;
|
|
gzip_http_version 1.1;
|
|
gzip_comp_level 6;
|
|
gzip_types *;
|
|
root /app;
|
|
|
|
# normal routes
|
|
# serve given url and default to index.html if not found
|
|
# e.g. /, /user and /foo/bar will return index.html
|
|
location / {
|
|
try_files $uri $uri/index.html /index.html;
|
|
add_header Cache-Control "private,no-cache";
|
|
add_header Last-Modified "Oct, 03 Jan 2022 13:46:41 GMT";
|
|
expires 0;
|
|
}
|
|
|
|
location /ws {
|
|
proxy_pass http://rss-svc.knowledge-shared:3100;
|
|
proxy_http_version 1.1;
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
proxy_set_header Connection "upgrade";
|
|
proxy_set_header Host $host;
|
|
}
|
|
|
|
location /knowledge {
|
|
proxy_pass http://KnowledgeServer;
|
|
add_header Access-Control-Allow-Headers "access-control-allow-headers,access-control-allow-methods,access-control-allow-origin,content-type,x-auth,x-unauth-error,x-authorization";
|
|
proxy_set_header Host $host;
|
|
proxy_set_header X-real-ip $remote_addr;
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
add_header X-Frame-Options SAMEORIGIN;
|
|
}
|
|
|
|
# location /rss {
|
|
# proxy_pass http://RSSServer;
|
|
#
|
|
# add_header Access-Control-Allow-Headers "access-control-allow-headers,access-control-allow-methods,access-control-allow-origin,content-type,x-auth,x-unauth-error,x-authorization";
|
|
# proxy_set_header Host $host;
|
|
# proxy_set_header X-real-ip $remote_addr;
|
|
# proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
#
|
|
# add_header X-Frame-Options SAMEORIGIN;
|
|
# }
|
|
|
|
# location /api/v1 {
|
|
# proxy_pass http://ArgoworkflowsSever;
|
|
# }
|
|
|
|
# location /artifact-files {
|
|
# proxy_pass http://ArgoworkflowsSever;
|
|
# }
|
|
|
|
location /videos/ {
|
|
if ($request_method = 'OPTIONS') {
|
|
add_header Access-Control-Allow-Headers "access-control-allow-headers,access-control-allow-methods,access-control-allow-origin,content-type,x-auth,x-unauth-error,x-authorization";
|
|
add_header Access-Control-Allow-Methods "PUT, GET, DELETE, POST, OPTIONS";
|
|
add_header Access-Control-Allow-Origin $http_origin;
|
|
add_header Access-Control-Allow-Credentials true;
|
|
|
|
add_header 'Access-Control-Max-Age' 1728000;
|
|
add_header 'Content-Type' 'text/plain; charset=utf-8';
|
|
add_header 'Content-Length' 0;
|
|
return 204;
|
|
}
|
|
add_header Access-Control-Allow-Headers "access-control-allow-headers,access-control-allow-methods,access-control-allow-origin,content-type,x-auth,x-unauth-error,x-authorization";
|
|
add_header Access-Control-Allow-Methods "PUT, GET, DELETE, POST, OPTIONS";
|
|
add_header Access-Control-Allow-Origin $http_origin;
|
|
proxy_pass http://files-proxy:28080;
|
|
}
|
|
|
|
location /api {
|
|
proxy_pass http://files-proxy:28080;
|
|
# rewrite ^/server(.*)$ $1 break;
|
|
|
|
# Add original-request-related headers
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
proxy_set_header X-Forwarded-Host $host;
|
|
|
|
add_header Accept-Ranges bytes;
|
|
|
|
client_body_timeout 600s;
|
|
client_max_body_size 4000M;
|
|
proxy_request_buffering off;
|
|
keepalive_timeout 750s;
|
|
proxy_read_timeout 600s;
|
|
proxy_send_timeout 600s;
|
|
}
|
|
|
|
location /upload {
|
|
proxy_pass http://files-proxy:28080;
|
|
# rewrite ^/server(.*)$ $1 break;
|
|
|
|
# Add original-request-related headers
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
proxy_set_header X-Forwarded-Host $host;
|
|
|
|
add_header Accept-Ranges bytes;
|
|
|
|
client_body_timeout 600s;
|
|
client_max_body_size 4000M;
|
|
proxy_request_buffering off;
|
|
keepalive_timeout 750s;
|
|
proxy_read_timeout 600s;
|
|
proxy_send_timeout 600s;
|
|
}
|
|
|
|
# # files
|
|
# # for all routes matching a dot, check for files and return 404 if not found
|
|
# # e.g. /file.js returns a 404 if not found
|
|
location ~.*\.(js|css|png|jpg|svg|woff|woff2)$
|
|
{
|
|
add_header Cache-Control "public, max-age=2678400";
|
|
}
|
|
} |