diff --git a/nginx.conf b/nginx.conf index 8c9e1e597e..3d8217ef80 100644 --- a/nginx.conf +++ b/nginx.conf @@ -441,3 +441,21 @@ server { # Redirect rule so that /python/docs actually leads somewhere rewrite ^/python/docs/?$ /python/docs/quick-start; } + +server { + listen 0.0.0.0:8080; + + server_name ~^(?[^.]+)\.preview\.docs\.apify\.com$; + + location ~ ^/(.*)/$ { + proxy_pass https://s3.amazonaws.com/apify-docs-preview/$subdomain/$1/index.html; + } + + location ~ ^/(.*[^./])$ { + proxy_pass https://s3.amazonaws.com/apify-docs-preview/$subdomain/$1.html; + } + + location / { + proxy_pass https://s3.amazonaws.com/apify-docs-preview/$subdomain/; + } +}