From 533c29722871d7dd1e37fe33029223a9bc91f0ea Mon Sep 17 00:00:00 2001 From: Anton Afanasyeu Date: Tue, 23 Jun 2026 12:29:30 +0200 Subject: [PATCH] initial --- README.md | 5 + .../crash_reporter/nginx.apps-builder.frag | 17 +++ .../crash_reporter/nginx.apps-port80.fragment | 134 ++++++++++++++++++ .../crash_reporter/nginx.apps.conf.fragment | 117 +++++++++++++++ .../nginx.fe-apps.conf.fragment | 3 + .../nginx.fe-apps.f0xx.org.snippet | 30 ++++ .../nginx.fe-build-inline.snippet | 13 ++ fragments/crash_reporter/nginx.fe-ota.snippet | 13 ++ .../rssh-bastion-stream.conf.example | 20 +++ fragments/hub/BE-apps-hub.conf.snippet | 15 ++ orchestration/nginx/build-fe.conf | 39 +++++ orchestration/nginx/crashes-fe.conf | 72 ++++++++++ orchestration/nginx/gitea-fe.conf | 33 +++++ orchestration/nginx/landing.conf | 63 ++++++++ 14 files changed, 574 insertions(+) create mode 100644 README.md create mode 100644 fragments/crash_reporter/nginx.apps-builder.frag create mode 100644 fragments/crash_reporter/nginx.apps-port80.fragment create mode 100644 fragments/crash_reporter/nginx.apps.conf.fragment create mode 100644 fragments/crash_reporter/nginx.fe-apps.conf.fragment create mode 100644 fragments/crash_reporter/nginx.fe-apps.f0xx.org.snippet create mode 100644 fragments/crash_reporter/nginx.fe-build-inline.snippet create mode 100644 fragments/crash_reporter/nginx.fe-ota.snippet create mode 100644 fragments/crash_reporter/rssh-bastion-stream.conf.example create mode 100644 fragments/hub/BE-apps-hub.conf.snippet create mode 100644 orchestration/nginx/build-fe.conf create mode 100644 orchestration/nginx/crashes-fe.conf create mode 100644 orchestration/nginx/gitea-fe.conf create mode 100644 orchestration/nginx/landing.conf diff --git a/README.md b/README.md new file mode 100644 index 0000000..5c006f8 --- /dev/null +++ b/README.md @@ -0,0 +1,5 @@ +# ac-platform-edge + +Nginx route fragments for apps.f0xx.org. + +Remote: `git://f0xx.org/ac/ac-platform-edge` diff --git a/fragments/crash_reporter/nginx.apps-builder.frag b/fragments/crash_reporter/nginx.apps-builder.frag new file mode 100644 index 0000000..0a6b532 --- /dev/null +++ b/fragments/crash_reporter/nginx.apps-builder.frag @@ -0,0 +1,17 @@ +location = /app/androidcast_project/build { + return 301 /app/androidcast_project/build/; +} + +location ^~ /app/androidcast_project/build/assets/ { + alias /var/www/localhost/htdocs/apps/app/androidcast_project/android_cast/examples/build_console/backend/public/assets/; +} + +location ^~ /app/androidcast_project/build/ { + include fastcgi_params; + fastcgi_pass unix:/run/php-fpm.socket; + fastcgi_param SCRIPT_FILENAME /var/www/localhost/htdocs/apps/app/androidcast_project/android_cast/examples/build_console/backend/public/index.php; + fastcgi_param SCRIPT_NAME /app/androidcast_project/build/index.php; + fastcgi_param REQUEST_URI $request_uri; + client_max_body_size 512m; + fastcgi_read_timeout 1800s; +} diff --git a/fragments/crash_reporter/nginx.apps-port80.fragment b/fragments/crash_reporter/nginx.apps-port80.fragment new file mode 100644 index 0000000..7945465 --- /dev/null +++ b/fragments/crash_reporter/nginx.apps-port80.fragment @@ -0,0 +1,134 @@ +# Full androidcast vhost for Alpine BE — listen 80 only. +# FE (apps.f0xx.org) proxies here: proxy_pass http://artc0.intra.raptor.org:80; +# Port 8089 is a different service (e.g. Janus) — not this vhost. + +server { + listen 80; + + # OTA v0 static tree — devices fetch https://apps.f0xx.org/v0/ota/channel/stable.json + # Populate: builder auto_deploy, or rsync out/ota/v0/ → .../ota-artifacts/v0/ + location ^~ /v0/ota/ { + alias /var/www/localhost/htdocs/apps/app/androidcast_project/ota-artifacts/v0/ota/; + add_header Cache-Control "public, max-age=60"; + } + + location = /app/androidcast_project { + return 301 /app/androidcast_project/; + } + + location = /app/androidcast_project/index.php { + include fastcgi_params; + fastcgi_pass unix:/run/php-fpm.socket; + fastcgi_param SCRIPT_FILENAME /var/www/localhost/htdocs/apps/app/androidcast_project/index.php; + fastcgi_param SCRIPT_NAME /app/androidcast_project/index.php; + } + + location = /app/androidcast_project/ { + rewrite ^ /app/androidcast_project/index.php last; + } + + location /app/androidcast_project/ { + alias /var/www/localhost/htdocs/apps/app/androidcast_project/; + index index.php index.html; + try_files $uri $uri/ =404; + } + + location = /app/androidcast_project/issues { + return 301 /app/androidcast_project/issues/; + } + + location = /app/androidcast_project/crashes { + return 301 /app/androidcast_project/issues/; + } + + location ~ ^/app/androidcast_project/crashes(/.*)?$ { + return 301 /app/androidcast_project/issues$1; + } + + location ~ ^/app/androidcast_project/(login|logout|register|two-factor|verify-email)(/|$) { + include fastcgi_params; + fastcgi_pass unix:/run/php-fpm.socket; + fastcgi_param SCRIPT_FILENAME /var/www/localhost/htdocs/apps/app/androidcast_project/android_cast/examples/crash_reporter/backend/public/index.php; + fastcgi_param SCRIPT_NAME /app/androidcast_project/issues/index.php; + fastcgi_param REQUEST_URI $request_uri; + } + + location ^~ /app/androidcast_project/issues/assets/ { + alias /var/www/localhost/htdocs/apps/app/androidcast_project/android_cast/examples/crash_reporter/backend/public/assets/; + } + + location = /app/androidcast_project/issues/api/upload.php { + include fastcgi_params; + fastcgi_pass unix:/run/php-fpm.socket; + fastcgi_param SCRIPT_FILENAME /var/www/localhost/htdocs/apps/app/androidcast_project/android_cast/examples/crash_reporter/backend/public/api/upload.php; + fastcgi_param SCRIPT_NAME /app/androidcast_project/issues/api/upload.php; + fastcgi_param REQUEST_URI $request_uri; + client_max_body_size 4m; + } + + location ^~ /app/androidcast_project/issues/ { + include fastcgi_params; + fastcgi_pass unix:/run/php-fpm.socket; + fastcgi_param SCRIPT_FILENAME /var/www/localhost/htdocs/apps/app/androidcast_project/android_cast/examples/crash_reporter/backend/public/index.php; + fastcgi_param SCRIPT_NAME /app/androidcast_project/issues/index.php; + fastcgi_param REQUEST_URI $request_uri; + client_max_body_size 4m; + } + + location = /app/androidcast_project/graphs { + return 301 /app/androidcast_project/graphs/; + } + + location ^~ /app/androidcast_project/graphs/assets/ { + alias /var/www/localhost/htdocs/apps/app/androidcast_project/android_cast/examples/crash_reporter/backend/public/assets/; + } + + location = /app/androidcast_project/graphs/api/graphs.php { + include fastcgi_params; + fastcgi_pass unix:/run/php-fpm.socket; + fastcgi_param SCRIPT_FILENAME /var/www/localhost/htdocs/apps/app/androidcast_project/android_cast/examples/crash_reporter/backend/public/api/graphs.php; + fastcgi_param SCRIPT_NAME /app/androidcast_project/graphs/api/graphs.php; + fastcgi_param REQUEST_URI $request_uri; + } + + location = /app/androidcast_project/graphs/api/graph_upload.php { + include fastcgi_params; + fastcgi_pass unix:/run/php-fpm.socket; + fastcgi_param SCRIPT_FILENAME /var/www/localhost/htdocs/apps/app/androidcast_project/android_cast/examples/crash_reporter/backend/public/api/graph_upload.php; + fastcgi_param SCRIPT_NAME /app/androidcast_project/graphs/api/graph_upload.php; + fastcgi_param REQUEST_URI $request_uri; + client_max_body_size 4m; + } + + location ^~ /app/androidcast_project/graphs/ { + include fastcgi_params; + fastcgi_pass unix:/run/php-fpm.socket; + fastcgi_param SCRIPT_FILENAME /var/www/localhost/htdocs/apps/app/androidcast_project/android_cast/examples/crash_reporter/backend/public/index.php; + fastcgi_param SCRIPT_NAME /app/androidcast_project/graphs/index.php; + fastcgi_param REQUEST_URI $request_uri; + client_max_body_size 4m; + } + + location = /app/androidcast_project/build { + return 301 /app/androidcast_project/build/; + } + + location ^~ /app/androidcast_project/build/assets/ { + alias /var/www/localhost/htdocs/apps/app/androidcast_project/android_cast/examples/build_console/backend/public/assets/; + } + + location ^~ /app/androidcast_project/build/ { + include fastcgi_params; + fastcgi_pass unix:/run/php-fpm.socket; + fastcgi_param SCRIPT_FILENAME /var/www/localhost/htdocs/apps/app/androidcast_project/android_cast/examples/build_console/backend/public/index.php; + fastcgi_param SCRIPT_NAME /app/androidcast_project/build/index.php; + fastcgi_param REQUEST_URI $request_uri; + client_max_body_size 512m; + fastcgi_read_timeout 1800s; + } + + location ~ \.php$ { + include /etc/nginx/fastcgi.conf; + fastcgi_pass unix:/run/php-fpm.socket; + } +} diff --git a/fragments/crash_reporter/nginx.apps.conf.fragment b/fragments/crash_reporter/nginx.apps.conf.fragment new file mode 100644 index 0000000..36312c7 --- /dev/null +++ b/fragments/crash_reporter/nginx.apps.conf.fragment @@ -0,0 +1,117 @@ +# Paste into the listen 443 (and 80) server {} in /etc/nginx/conf.d/apps.conf +# Replaces old per-URL blocks + any backend symlink paths. + + location ^~ /v0/ota/ { + alias /var/www/localhost/htdocs/apps/app/androidcast_project/ota-artifacts/v0/ota/; + add_header Cache-Control "public, max-age=60"; + } + + location = /app/androidcast_project/crashes { + return 301 /app/androidcast_project/crashes/; + } + + location = /app/androidcast_project/graphs { + return 301 /app/androidcast_project/graphs/; + } + + location = /app/androidcast_project { + return 301 /app/androidcast_project/; + } + + # Hub — see nginx.apps-port80.fragment (index.php + shared footer). + location = /app/androidcast_project/index.php { + include fastcgi_params; + fastcgi_pass unix:/run/php-fpm.socket; + fastcgi_param SCRIPT_FILENAME /var/www/localhost/htdocs/apps/app/androidcast_project/index.php; + fastcgi_param SCRIPT_NAME /app/androidcast_project/index.php; + } + + location = /app/androidcast_project/ { + rewrite ^ /app/androidcast_project/index.php last; + } + + location /app/androidcast_project/ { + alias /var/www/localhost/htdocs/apps/app/androidcast_project/; + index index.php index.html; + try_files $uri $uri/ =404; + } + + location ^~ /app/androidcast_project/crashes/assets/ { + alias /var/www/localhost/htdocs/apps/app/androidcast_project/android_cast/examples/crash_reporter/backend/public/assets/; + } + + location = /app/androidcast_project/crashes/api/upload.php { + include fastcgi_params; + fastcgi_pass unix:/run/php-fpm.socket; + fastcgi_param SCRIPT_FILENAME /var/www/localhost/htdocs/apps/app/androidcast_project/android_cast/examples/crash_reporter/backend/public/api/upload.php; + fastcgi_param SCRIPT_NAME /app/androidcast_project/crashes/api/upload.php; + fastcgi_param REQUEST_URI $request_uri; + client_max_body_size 4m; + } + + location = /app/androidcast_project/crashes/api/diag.php { + include fastcgi_params; + fastcgi_pass unix:/run/php-fpm.socket; + fastcgi_param SCRIPT_FILENAME /var/www/localhost/htdocs/apps/app/androidcast_project/android_cast/examples/crash_reporter/backend/public/api/diag.php; + fastcgi_param SCRIPT_NAME /app/androidcast_project/crashes/api/diag.php; + fastcgi_param REQUEST_URI $request_uri; + } + + location = /app/androidcast_project/crashes/api/reports.php { + include fastcgi_params; + fastcgi_pass unix:/run/php-fpm.socket; + fastcgi_param SCRIPT_FILENAME /var/www/localhost/htdocs/apps/app/androidcast_project/android_cast/examples/crash_reporter/backend/public/api/reports.php; + fastcgi_param SCRIPT_NAME /app/androidcast_project/crashes/api/reports.php; + fastcgi_param REQUEST_URI $request_uri; + } + + location = /app/androidcast_project/crashes/api/report_viewed.php { + include fastcgi_params; + fastcgi_pass unix:/run/php-fpm.socket; + fastcgi_param SCRIPT_FILENAME /var/www/localhost/htdocs/apps/app/androidcast_project/android_cast/examples/crash_reporter/backend/public/api/report_viewed.php; + fastcgi_param SCRIPT_NAME /app/androidcast_project/crashes/api/report_viewed.php; + fastcgi_param REQUEST_URI $request_uri; + } + + location = /app/androidcast_project/crashes/api/report_tags.php { + include fastcgi_params; + fastcgi_pass unix:/run/php-fpm.socket; + fastcgi_param SCRIPT_FILENAME /var/www/localhost/htdocs/apps/app/androidcast_project/android_cast/examples/crash_reporter/backend/public/api/report_tags.php; + fastcgi_param SCRIPT_NAME /app/androidcast_project/crashes/api/report_tags.php; + fastcgi_param REQUEST_URI $request_uri; + } + + location ^~ /app/androidcast_project/crashes/ { + include fastcgi_params; + fastcgi_pass unix:/run/php-fpm.socket; + fastcgi_param SCRIPT_FILENAME /var/www/localhost/htdocs/apps/app/androidcast_project/android_cast/examples/crash_reporter/backend/public/index.php; + fastcgi_param SCRIPT_NAME /app/androidcast_project/crashes/index.php; + fastcgi_param REQUEST_URI $request_uri; + client_max_body_size 4m; + } + + location = /app/androidcast_project/graphs/api/graphs.php { + include fastcgi_params; + fastcgi_pass unix:/run/php-fpm.socket; + fastcgi_param SCRIPT_FILENAME /var/www/localhost/htdocs/apps/app/androidcast_project/android_cast/examples/crash_reporter/backend/public/api/graphs.php; + fastcgi_param SCRIPT_NAME /app/androidcast_project/graphs/api/graphs.php; + fastcgi_param REQUEST_URI $request_uri; + } + + location = /app/androidcast_project/graphs/api/graph_upload.php { + include fastcgi_params; + fastcgi_pass unix:/run/php-fpm.socket; + fastcgi_param SCRIPT_FILENAME /var/www/localhost/htdocs/apps/app/androidcast_project/android_cast/examples/crash_reporter/backend/public/api/graph_upload.php; + fastcgi_param SCRIPT_NAME /app/androidcast_project/graphs/api/graph_upload.php; + fastcgi_param REQUEST_URI $request_uri; + client_max_body_size 4m; + } + + location ^~ /app/androidcast_project/graphs/ { + include fastcgi_params; + fastcgi_pass unix:/run/php-fpm.socket; + fastcgi_param SCRIPT_FILENAME /var/www/localhost/htdocs/apps/app/androidcast_project/android_cast/examples/crash_reporter/backend/public/index.php; + fastcgi_param SCRIPT_NAME /app/androidcast_project/graphs/index.php; + fastcgi_param REQUEST_URI $request_uri; + client_max_body_size 4m; + } diff --git a/fragments/crash_reporter/nginx.fe-apps.conf.fragment b/fragments/crash_reporter/nginx.fe-apps.conf.fragment new file mode 100644 index 0000000..7cebdb0 --- /dev/null +++ b/fragments/crash_reporter/nginx.fe-apps.conf.fragment @@ -0,0 +1,3 @@ +# DEPRECATED — use nginx/fe/apps.conf (full apps.f0xx.org vhost). +# nginx.conf should contain only: include /etc/nginx/apps.conf; +# See patches/fe-nginx-APPLY.md and scripts/generate-fe-nginx-patch.sh diff --git a/fragments/crash_reporter/nginx.fe-apps.f0xx.org.snippet b/fragments/crash_reporter/nginx.fe-apps.f0xx.org.snippet new file mode 100644 index 0000000..d9fe6cc --- /dev/null +++ b/fragments/crash_reporter/nginx.fe-apps.f0xx.org.snippet @@ -0,0 +1,30 @@ +# FE apps.f0xx.org — replace hub/crashes upstream blocks (use BE port 80, preserve URI). +# OTA at /v0/ota/ must proxy to BE :80 even when hub uses :443 — see nginx.fe-ota.snippet +# and scripts/install-fe-ota-nginx.sh (public URL 400 until this is applied on FE). +# +# File: tmp/FE_gentoo/etc/nginx/nginx.conf (inside server { listen 443; server_name apps.f0xx.org; }) +# +# WRONG (causes browser to download index.php as application/octet-stream): +# proxy_pass https://artc0.intra.raptor.org/app/androidcast_project/; +# BE :443 serves static files; hub must hit BE :80 (PHP-FPM) like location / already does. + + location /app/androidcast_project/ { + proxy_pass http://artc0.intra.raptor.org:80; + 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; + } + + location /app/androidcast_project/crashes/ { + proxy_pass http://artc0.intra.raptor.org:80; + 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; + } + +# apps.conf build block must stay: +# proxy_pass http://artc0.intra.raptor.org:80; (no trailing slash) diff --git a/fragments/crash_reporter/nginx.fe-build-inline.snippet b/fragments/crash_reporter/nginx.fe-build-inline.snippet new file mode 100644 index 0000000..1559ffb --- /dev/null +++ b/fragments/crash_reporter/nginx.fe-build-inline.snippet @@ -0,0 +1,13 @@ +# Paste into Gentoo FE /etc/nginx/nginx.conf inside server { listen 443; server_name apps.f0xx.org; } +# Place immediately AFTER the crashes location block (same style as hub + crashes). + + location /app/androidcast_project/build/ { + proxy_pass https://artc0.intra.raptor.org/app/androidcast_project/build/; + } + +# Then REMOVE or comment out the build location in /etc/nginx/apps.conf (avoid duplicate/conflict). +# Reload: nginx -t && rc-service nginx reload + +# Verify from FE: +# curl -sSI -H 'Host: apps.f0xx.org' http://127.0.0.1/app/androidcast_project/build/ | head -5 +# Expect 302 + x-powered-by: PHP (after BE fragment is fixed too). diff --git a/fragments/crash_reporter/nginx.fe-ota.snippet b/fragments/crash_reporter/nginx.fe-ota.snippet new file mode 100644 index 0000000..12fb070 --- /dev/null +++ b/fragments/crash_reporter/nginx.fe-ota.snippet @@ -0,0 +1,13 @@ +# FE apps.f0xx.org — OTA channel at site root (/v0/ota/…). +# BE serves files on listen 80; hub/crashes may use :443 upstream — OTA must hit :80. +# +# Paste inside server { listen 443 ssl; server_name apps.f0xx.org; } before androidcast blocks. + + location /v0/ota/ { + proxy_pass http://artc0.intra.raptor.org:80; + 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; + } diff --git a/fragments/crash_reporter/rssh-bastion-stream.conf.example b/fragments/crash_reporter/rssh-bastion-stream.conf.example new file mode 100644 index 0000000..5e5e4ae --- /dev/null +++ b/fragments/crash_reporter/rssh-bastion-stream.conf.example @@ -0,0 +1,20 @@ +# FE nginx stream — TCP proxy to BE sshd for RSSH bastion (ra.apps.f0xx.org:443). +# Install on FE (Gentoo); BE runs openssh with Match User ra-* (see sshd_config.d/ra.conf). +# +# *** DO NOT install under BE /etc/nginx/stream.d/ *** +# BE already uses listen 443 ssl in conf.d/apps.conf (http). Stream listen 443 here +# causes: nginx: [emerg] bind() to 0.0.0.0:443 failed (98: Address in use) +# +# Include from nginx.conf: +# include /etc/nginx/stream.d/rssh-bastion.conf; + +upstream rssh_bastion_be { + server 10.7.16.128:22; # artc0 / alpine-be — adjust for cluster/lab +} + +server { + listen 443; + proxy_pass rssh_bastion_be; + proxy_connect_timeout 30s; + proxy_timeout 24h; +} diff --git a/fragments/hub/BE-apps-hub.conf.snippet b/fragments/hub/BE-apps-hub.conf.snippet new file mode 100644 index 0000000..28f0d4c --- /dev/null +++ b/fragments/hub/BE-apps-hub.conf.snippet @@ -0,0 +1,15 @@ +# Replace the broken hub block in /etc/nginx/conf.d/apps.conf on Alpine BE. +# Remove duplicate "return 301 .../crashes/" and alias-to-index.html lines. + +location = /app/androidcast_project { + return 301 /app/androidcast_project/; +} + +location /app/androidcast_project/ { + alias /var/www/localhost/htdocs/apps/app/androidcast_project/; + index index.php index.html; +} + +location ^~ /app/androidcast_project/crashes/assets/ { + alias /var/www/localhost/htdocs/apps/app/androidcast_project/android_cast/examples/crash_reporter/backend/public/assets/; +} diff --git a/orchestration/nginx/build-fe.conf b/orchestration/nginx/build-fe.conf new file mode 100644 index 0000000..2f4b605 --- /dev/null +++ b/orchestration/nginx/build-fe.conf @@ -0,0 +1,39 @@ +server { + listen 8080; + server_name _; + + client_max_body_size 64m; + index index.php; + + location = / { + return 302 /app/androidcast_project/build/; + } + + location /app/androidcast_project/build/ { + alias /workspace/examples/build_console/backend/public/; + index index.php; + try_files $uri $uri/ @build_front; + } + + location /app/androidcast_project/crashes/assets/ { + alias /workspace/examples/crash_reporter/backend/public/assets/; + } + + location @build_front { + rewrite ^ /app/androidcast_project/build/index.php?$query_string last; + } + + location ~ ^/app/androidcast_project/build/(.+\.php)$ { + alias /workspace/examples/build_console/backend/public/$1; + include fastcgi_params; + fastcgi_param SCRIPT_FILENAME /workspace/examples/build_console/backend/public/$1; + fastcgi_param SCRIPT_NAME /app/androidcast_project/build/$1; + fastcgi_param DOCUMENT_ROOT /workspace/examples/build_console/backend/public; + fastcgi_pass build-php:9000; + fastcgi_read_timeout 300s; + } + + location ~ /\. { + deny all; + } +} diff --git a/orchestration/nginx/crashes-fe.conf b/orchestration/nginx/crashes-fe.conf new file mode 100644 index 0000000..cc52003 --- /dev/null +++ b/orchestration/nginx/crashes-fe.conf @@ -0,0 +1,72 @@ +server { + listen 8080; + server_name _; + + client_max_body_size 16m; + index index.php; + + location = / { + return 302 /app/androidcast_project/crashes/; + } + + location = /app/androidcast_project/graphs { + return 302 /app/androidcast_project/graphs/; + } + + location ^~ /app/androidcast_project/graphs/assets/ { + alias /workspace/examples/crash_reporter/backend/public/assets/; + } + + location = /app/androidcast_project/graphs/api/graphs.php { + include fastcgi_params; + fastcgi_param SCRIPT_FILENAME /workspace/examples/crash_reporter/backend/public/api/graphs.php; + fastcgi_param SCRIPT_NAME /app/androidcast_project/graphs/api/graphs.php; + fastcgi_param DOCUMENT_ROOT /workspace/examples/crash_reporter/backend/public; + fastcgi_pass crash-php:9000; + fastcgi_read_timeout 120s; + } + + location = /app/androidcast_project/graphs/api/graph_upload.php { + include fastcgi_params; + fastcgi_param SCRIPT_FILENAME /workspace/examples/crash_reporter/backend/public/api/graph_upload.php; + fastcgi_param SCRIPT_NAME /app/androidcast_project/graphs/api/graph_upload.php; + fastcgi_param DOCUMENT_ROOT /workspace/examples/crash_reporter/backend/public; + fastcgi_pass crash-php:9000; + client_max_body_size 4m; + fastcgi_read_timeout 120s; + } + + location ^~ /app/androidcast_project/graphs/ { + include fastcgi_params; + fastcgi_param SCRIPT_FILENAME /workspace/examples/crash_reporter/backend/public/index.php; + fastcgi_param SCRIPT_NAME /app/androidcast_project/graphs/index.php; + fastcgi_param REQUEST_URI $request_uri; + fastcgi_param DOCUMENT_ROOT /workspace/examples/crash_reporter/backend/public; + fastcgi_pass crash-php:9000; + fastcgi_read_timeout 120s; + } + + location /app/androidcast_project/crashes/ { + alias /workspace/examples/crash_reporter/backend/public/; + index index.php; + try_files $uri $uri/ @crashes_front; + } + + location @crashes_front { + rewrite ^ /app/androidcast_project/crashes/index.php?$query_string last; + } + + location ~ ^/app/androidcast_project/crashes/(.+\.php)$ { + alias /workspace/examples/crash_reporter/backend/public/$1; + include fastcgi_params; + fastcgi_param SCRIPT_FILENAME /workspace/examples/crash_reporter/backend/public/$1; + fastcgi_param SCRIPT_NAME /app/androidcast_project/crashes/$1; + fastcgi_param DOCUMENT_ROOT /workspace/examples/crash_reporter/backend/public; + fastcgi_pass crash-php:9000; + fastcgi_read_timeout 120s; + } + + location ~ /\. { + deny all; + } +} diff --git a/orchestration/nginx/gitea-fe.conf b/orchestration/nginx/gitea-fe.conf new file mode 100644 index 0000000..d38e889 --- /dev/null +++ b/orchestration/nginx/gitea-fe.conf @@ -0,0 +1,33 @@ +server { + listen 8080; + server_name _; + + client_max_body_size 64m; + + location /app/androidcast_project/git/ { + rewrite ^/app/androidcast_project/git/?(.*)$ /$1 break; + proxy_pass http://gitea:3000; + 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 X-Forwarded-Port $server_port; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + } + + location / { + proxy_pass http://gitea:3000; + 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 X-Forwarded-Port $server_port; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + } +} diff --git a/orchestration/nginx/landing.conf b/orchestration/nginx/landing.conf new file mode 100644 index 0000000..50ae006 --- /dev/null +++ b/orchestration/nginx/landing.conf @@ -0,0 +1,63 @@ +server { + listen 8080; + server_name _; + + client_max_body_size 16m; + + location = / { + return 302 /app/androidcast_project/; + } + + location /app/androidcast_project/git/ { + return 302 http://localhost:8081/; + } + + location /app/androidcast_project/crashes/ { + proxy_pass http://crashes-fe:8080; + 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; + } + + location /app/androidcast_project/graphs/ { + proxy_pass http://crashes-fe:8080; + 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; + } + + location /app/androidcast_project/build/ { + proxy_pass http://build-fe:8080; + 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; + } + + location /app/androidcast_project/v0/ota/ { + alias /workspace/orchestration/runtime/ota-artifacts/v0/; + add_header Cache-Control "public, max-age=60"; + } + + location = /app/androidcast_project/index.php { + include fastcgi_params; + fastcgi_param SCRIPT_FILENAME /workspace/examples/app_hub/index.php; + fastcgi_param SCRIPT_NAME /app/androidcast_project/index.php; + fastcgi_pass crash-php:9000; + } + + location = /app/androidcast_project/ { + rewrite ^ /app/androidcast_project/index.php last; + } + + location /app/androidcast_project/ { + alias /workspace/examples/app_hub/; + index index.php index.html; + try_files $uri $uri/ =404; + } +}