@@ -446,18 +446,45 @@ server {
446
446
447
447
server {
448
448
listen 0.0.0.0:8080;
449
-
449
+ resolver 172.20.0.10 ;
450
450
server_name ~^(?<subdomain>[^.]+)\.preview\.docs\.apify\.com$ ;
451
451
452
+ # add trailing slashes to the root of GH pages docs
453
+ rewrite ^/api/client/js$ /api/client/js/ redirect;
454
+ rewrite ^/api/client/python$ /api/client/python/ redirect;
455
+ rewrite ^/sdk/js$ /sdk/js/ redirect;
456
+ rewrite ^/sdk/python$ /sdk/python/ redirect;
457
+ rewrite ^/cli$ /cli/ redirect;
458
+
459
+ location ~ ^/api/client/js/(.*)$ {
460
+ proxy_pass https://apify.github.io/apify-client-js/$1 ;
461
+ }
462
+ location ~ ^/api/client/python/(.*)$ {
463
+ proxy_pass https://apify.github.io/apify-client-python/$1 ;
464
+ }
465
+ location ~ ^/sdk/js/(.*)$ {
466
+ proxy_pass https://apify.github.io/apify-sdk-js/$1 ;
467
+ }
468
+ location ~ ^/sdk/python/(.*)$ {
469
+ proxy_pass https://apify.github.io/apify-sdk-python/$1 ;
470
+ }
471
+ location ~ ^/cli/(.*)$ {
472
+ proxy_pass https://apify.github.io/apify-cli/$1 ;
473
+ }
474
+
475
+ location = / {
476
+ proxy_pass https://s3.amazonaws.com/apify-docs-preview/$subdomain /index.html;
477
+ }
452
478
location ~ ^/(.*)/$ {
453
479
proxy_pass https://s3.amazonaws.com/apify-docs-preview/$subdomain /$1 /index.html;
454
480
}
455
-
456
- location ~ ^/(.*[^./])$ {
481
+ location ~ ^/([^.]+)$ {
457
482
proxy_pass https://s3.amazonaws.com/apify-docs-preview/$subdomain /$1 .html;
458
483
}
459
-
484
+ location ~ ^/(.*)$ {
485
+ proxy_pass https://s3.amazonaws.com/apify-docs-preview/$subdomain /$1 ;
486
+ }
460
487
location / {
461
- proxy_pass https://s3.amazonaws.com/apify-docs-preview/$subdomain / ;
488
+ proxy_pass https://s3.amazonaws.com/apify-docs-preview/$subdomain$uri ;
462
489
}
463
- }
490
+ }
0 commit comments