Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- proxy_cache_path /var/snap/subutai/common/cache/nginx/templ/ levels=1:2 keys_zone=TEM:10m inactive=1w max_size=20g;
- proxy_cache_path /var/snap/subutai/common/cache/nginx/deb/ levels=1:2 keys_zone=APT:10m inactive=1w max_size=10g;
- proxy_cache_path /var/snap/subutai/common/cache/nginx/raw/ levels=1:2 keys_zone=RAW:10m inactive=1w max_size=10g;
- proxy_cache_path /var/snap/subutai/common/cache/nginx/qry/ levels=1:2 keys_zone=QRY:10m inactive=1w max_size=1g;
- proxy_cache_use_stale error timeout updating http_500 http_502 http_503 http_504;
- proxy_cache_lock on;
- proxy_cache_lock_age 20m;
- proxy_cache_lock_timeout 20m;
- proxy_connect_timeout 10;
- proxy_send_timeout 1200;
- proxy_read_timeout 1200;
- send_timeout 1200;
- proxy_cache_revalidate on;
- proxy_request_buffering off;
- server {
- listen 80;
- server_name <cdn domain>;
- return 301 https://$host:8338$request_uri;
- }
- server {
- listen 8338;
- server_name <cdn domain>;
- client_max_body_size 2G;
- proxy_connect_timeout 6000;
- proxy_send_timeout 6000;
- proxy_read_timeout 6000;
- send_timeout 6000;
- ssl on;
- ssl_certificate <public certificate>;
- ssl_certificate_key <certificate private key>;
- error_page 497 https://$host$request_uri;
- location ~ /kurjun/rest/template/(get|download) {
- proxy_pass https://eu0.<cdn domain>:8338$request_uri;
- proxy_cache TEM;
- proxy_cache_valid 1m;
- proxy_ignore_headers "Cache-Control" "Expires";
- }
- location /kurjun/rest/apt/(get|download) {
- proxy_pass https://eu0.<cdn domain>:8338$request_uri;
- proxy_cache APT;
- proxy_cache_valid 1m;
- proxy_ignore_headers "Cache-Control" "Expires";
- }
- location ~ /kurjun/rest/raw/(get|download) {
- proxy_pass https://eu0.<cdn domain>:8338$request_uri;
- proxy_cache RAW;
- proxy_cache_valid 1m;
- proxy_ignore_headers "Cache-Control" "Expires";
- }
- location /kurjun/rest/auth {
- proxy_pass https://eu0.<cdn domain>:8338$request_uri;
- }
- location /kurjun/rest/auth/validate {
- if ($http_origin ~* (https?://[^/]*\.subut\.ai|https://subutai.io)) {
- set $cors "true";
- add_header 'Access-Control-Allow-Origin' "$http_origin";
- }
- if ($request_method = 'OPTIONS') {
- set $cors "${cors}options";
- }
- if ($request_method = 'GET') {
- set $cors "${cors}get";
- }
- if ($request_method = 'POST') {
- set $cors "${cors}post";
- }
- if ($cors = "true") {
- add_header 'Access-Control-Allow-Origin' "$http_origin";
- }
- if ($cors = "trueget") {
- add_header 'Access-Control-Allow-Origin' "$http_origin";
- add_header 'Access-Control-Allow-Credentials' 'true';
- add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
- add_header 'Access-Control-Allow-Headers' 'token,DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type';
- }
- if ($cors = "trueoptions") {
- add_header 'Access-Control-Allow-Origin' "$http_origin";
- add_header 'Access-Control-Allow-Credentials' 'true';
- add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
- add_header 'Access-Control-Allow-Headers' 'token,DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type';
- add_header 'Access-Control-Max-Age' 1728000;
- add_header 'Content-Type' 'text/plain charset=UTF-8';
- add_header 'Content-Length' 0;
- return 204;
- }
- if ($cors = "truepost") {
- add_header 'Access-Control-Allow-Origin' "$http_origin";
- add_header 'Access-Control-Allow-Credentials' 'true';
- add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
- add_header 'Access-Control-Allow-Headers' 'token,DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type';
- }
- proxy_pass https://eu0.<cdn domain>:8338/kurjun/rest/auth/validate;
- proxy_cache QRY;
- proxy_cache_valid 1m;
- proxy_ignore_headers "Cache-Control" "Expires";
- }
- location /kurjun {
- if ($http_origin ~* (https?://[^/]*\.subut\.ai|https://subutai.io)) {
- set $cors "true";
- add_header 'Access-Control-Allow-Origin' "$http_origin";
- }
- if ($request_method = 'OPTIONS') {
- set $cors "${cors}options";
- }
- if ($request_method = 'GET') {
- set $cors "${cors}get";
- }
- if ($request_method = 'POST') {
- set $cors "${cors}post";
- }
- if ($cors = "true") {
- add_header 'Access-Control-Allow-Origin' "$http_origin";
- }
- if ($cors = "trueget") {
- add_header 'Access-Control-Allow-Origin' "$http_origin";
- add_header 'Access-Control-Allow-Credentials' 'true';
- add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
- add_header 'Access-Control-Allow-Headers' 'token,DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type';
- }
- if ($cors = "trueoptions") {
- add_header 'Access-Control-Allow-Origin' "$http_origin";
- add_header 'Access-Control-Allow-Credentials' 'true';
- add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
- add_header 'Access-Control-Allow-Headers' 'token,DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type';
- add_header 'Access-Control-Max-Age' 1728000;
- add_header 'Content-Type' 'text/plain charset=UTF-8';
- add_header 'Content-Length' 0;
- return 204;
- }
- if ($cors = "truepost") {
- add_header 'Access-Control-Allow-Origin' "$http_origin";
- add_header 'Access-Control-Allow-Credentials' 'true';
- add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
- add_header 'Access-Control-Allow-Headers' 'token,DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type';
- }
- proxy_pass https://eu0.<cdn domain>:8338/kurjun;
- proxy_cache QRY;
- proxy_cache_valid 1m;
- proxy_ignore_headers "Cache-Control" "Expires";
- }
- }
- server {
- listen 8080;
- server_name <cdn domain>;
- client_max_body_size 2G;
- location /kurjun/rest/apt {
- proxy_pass https://eu0.<cdn domain>:8338$request_uri;
- proxy_cache APT;
- proxy_cache_valid 1m;
- proxy_ignore_headers "Cache-Control" "Expires";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement