Skip to content
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
64 changes: 53 additions & 11 deletions .werf/nginx-local.conf
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,15 @@ events {
}

http {
resolver 127.0.0.11 valid=30s ipv6=off;
resolver_timeout 30s;
proxy_cache_path /cache keys_zone=dcache:10m max_size=200m inactive=30d;

# Global timeout settings
keepalive_timeout 65;
client_body_timeout 60s;
client_header_timeout 60s;
send_timeout 60s;

log_format json_combined escape=json '{ "time_local": "$time_local", '
'"host": "$host", '
Expand All @@ -36,7 +44,7 @@ http {
hostnames;
".deckhouse.ru" "ru";
# for test environments
".deckhouse.ru.*" "ru";
".deckhouse-ru.*" "ru";
"ru.localhost" "ru";
default "en";
}
Expand All @@ -59,6 +67,11 @@ http {
default "deckhouse.ru";
}

map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}

upstream deckhouse_io {
server deckhouse.io:443;
}
Expand All @@ -67,6 +80,16 @@ http {
server deckhouse.ru:443;
}

upstream hugo_1313 {
zone hugo_1313 64k;
server hugo:1313 resolve max_fails=0;
}

upstream hugo_1314 {
zone hugo_1314 64k;
server hugo:1314 resolve max_fails=0;
}

server {
root /app;
index index.html;
Expand Down Expand Up @@ -101,27 +124,46 @@ http {
proxy_pass $publicdocupstream;
}

location ~* /products/development-platform/(livereload|documentation/).*$ {
# Specific location for livereload WebSocket endpoint
location ~* ^.*/(livereload|livereload\.js) {
# Don't retry WebSocket connections - they can't be retried
proxy_next_upstream off;
proxy_next_upstream_timeout 0;
proxy_next_upstream_tries 1;

proxy_redirect off;
proxy_intercept_errors on;
proxy_intercept_errors off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Original-URI $request_uri;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

# WebSocket support for livereload
proxy_connect_timeout 10s;
proxy_send_timeout 3600s;
proxy_read_timeout 3600s;

proxy_buffering off;
proxy_request_buffering off;

# WebSocket support - ensure proper headers
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Connection $connection_upgrade;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Host $host;

proxy_pass http://$hugo_upstream;
}
}
upstream hugo_1313 {
server hugo:1313;
}

upstream hugo_1314 {
server hugo:1314;
location ~* ^/products/development-platform/documentation/.*$ {
proxy_redirect off;
proxy_intercept_errors on;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Original-URI $request_uri;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

proxy_pass http://$hugo_upstream;
}
}
}
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

This is the source for the Deckhouse Development Platform documentation website.

The project uses [Hugo](https://gohugo.io/) SSG and the [hugo-web-product-module](https://github.com/deckhouse/hugo-web-product-module/) module for a theme.

Read [`hugo-web-product-module` README.md](https://github.com/deckhouse/hugo-web-product-module/blob/main/README.md) for information about content markup and other details.

## How to run the documentation site locally

To run locally:
1. Install werf and docker.
1. Run:
Expand All @@ -11,5 +17,3 @@ To run locally:
```

1. Open `http://localhost/products/development-platform/documentation/` in your browser (for the english version) or `http://ru.localhost/products/development-platform/documentation/` (for the russian version).

The project uses the [hugo-web-product-module](https://github.com/deckhouse/hugo-web-product-module/).
9 changes: 8 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ services:
ports:
- "80:80"
depends_on:
- hugo
hugo:
condition: service_healthy

hugo:
image: hugomods/hugo:debian-ci-0.150.1
Expand All @@ -18,3 +19,9 @@ services:
volumes:
- "./:/src"
- "../hugo-web-product-module/:/hugo-web-product-module:ro"
healthcheck:
test: ["CMD-SHELL", "curl -s http://localhost:1313 > /dev/null || exit 1"]
interval: 5s
timeout: 2s
retries: 10
start_period: 1s
Loading