mirror of
git://f0xx.org/android_cast
synced 2026-07-29 03:38:52 +03:00
snapshot
This commit is contained in:
@@ -48,11 +48,20 @@ Or run (from repo, with write access to the mount):
|
||||
sudo ./examples/crash_reporter/backend/scripts/apply-be-port80-nginx.sh
|
||||
```
|
||||
|
||||
**FE** (`tmp/FE_gentoo/etc/nginx/nginx.conf`): hub and crashes must use
|
||||
`proxy_pass http://artc0.intra.raptor.org:80;` **without** a trailing slash or path suffix.
|
||||
See **`nginx.fe-apps.f0xx.org.snippet`**.
|
||||
**FE** (`tmp/FE_gentoo/etc/nginx/apps.conf`): build must proxy to BE **:443** like hub/crashes:
|
||||
|
||||
The **`listen 443 ssl`** block can stay for direct HTTPS to the VM if you use it internally; public traffic from FE should prefer **:80** for one consistent vhost.
|
||||
```nginx
|
||||
proxy_pass https://artc0.intra.raptor.org/app/androidcast_project/build/;
|
||||
```
|
||||
|
||||
Do **not** use `http://artc0.intra.raptor.org:80` for build until BE `listen 80` includes the build block.
|
||||
Copy from **`nginx.fe-apps.conf.fragment`** or run:
|
||||
|
||||
```bash
|
||||
sudo ./examples/crash_reporter/backend/scripts/apply-build-nginx-fix.sh
|
||||
```
|
||||
|
||||
**BE** `conf.d/apps_builder.frag` must use **full paths** (no `...` placeholders). Same script installs the repo fragment.
|
||||
|
||||
Use prefix location for the hub (not `alias` to a single file):
|
||||
|
||||
|
||||
21
examples/crash_reporter/backend/nginx.fe-apps.conf.fragment
Normal file
21
examples/crash_reporter/backend/nginx.fe-apps.conf.fragment
Normal file
@@ -0,0 +1,21 @@
|
||||
# FE apps.f0xx.org — include from nginx.conf server block.
|
||||
# Build must use the same upstream style as hub/crashes (BE :443), not :80.
|
||||
|
||||
# Redirect without trailing slash
|
||||
location = /app/androidcast_project/build {
|
||||
return 301 $scheme://$host/app/androidcast_project/build/;
|
||||
}
|
||||
location /app/androidcast_project/build/ {
|
||||
proxy_pass https://artc0.intra.raptor.org/app/androidcast_project/build/;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
proxy_set_header X-Forwarded-Host $host;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection $connection_upgrade;
|
||||
proxy_read_timeout 1800s;
|
||||
proxy_send_timeout 1800s;
|
||||
client_max_body_size 512m;
|
||||
}
|
||||
27
examples/crash_reporter/backend/scripts/apply-build-nginx-fix.sh
Executable file
27
examples/crash_reporter/backend/scripts/apply-build-nginx-fix.sh
Executable file
@@ -0,0 +1,27 @@
|
||||
#!/usr/bin/env bash
|
||||
# Fix builder nginx on sshfs mounts + optional reload on hosts.
|
||||
set -euo pipefail
|
||||
REPO="$(cd "$(dirname "$0")/../../.." && pwd)"
|
||||
BE_NGINX="${BE_NGINX:-$REPO/../../../tmp/BE_alpine/etc/nginx/conf.d}"
|
||||
FE_NGINX="${FE_NGINX:-$REPO/../../../tmp/FE_gentoo/etc/nginx}"
|
||||
|
||||
install -D -m 0644 "$REPO/crash_reporter/backend/nginx.apps-builder.frag" \
|
||||
"$BE_NGINX/apps_builder.frag"
|
||||
install -D -m 0644 "$REPO/crash_reporter/backend/nginx.fe-apps.conf.fragment" \
|
||||
"$FE_NGINX/apps.conf"
|
||||
|
||||
if [[ "${1:-}" == "--port80" ]]; then
|
||||
"$REPO/crash_reporter/backend/scripts/apply-be-port80-nginx.sh" \
|
||||
"$BE_NGINX/apps.conf"
|
||||
fi
|
||||
|
||||
echo "Installed:"
|
||||
echo " $BE_NGINX/apps_builder.frag"
|
||||
echo " $FE_NGINX/apps.conf"
|
||||
echo
|
||||
echo "Reload on hosts:"
|
||||
echo " ssh alpine-be 'sudo nginx -t && sudo rc-service nginx reload'"
|
||||
echo " # Gentoo FE: sudo nginx -t && sudo rc-service nginx reload"
|
||||
echo
|
||||
echo "Verify:"
|
||||
echo " curl -sSI 'https://apps.f0xx.org/app/androidcast_project/build/' | grep -E 'HTTP|location|x-powered-by'"
|
||||
Reference in New Issue
Block a user