49 lines
1.3 KiB
Nginx Configuration File
49 lines
1.3 KiB
Nginx Configuration File
events {
|
|||
|
|
worker_connections 768;
|
||
|
|
}
|
||
|
|
|
||
|
|
http {
|
||
|
|
|
||
|
|
include /etc/nginx/mime.types;
|
||
|
|
default_type application/octet-stream;
|
||
|
|
|
||
|
|
server {
|
||
|
|
|
||
|
|
listen 80;
|
||
|
|
server_name _;
|
||
|
|
root /usr/share/nginx/html;
|
||
|
|
|
||
|
|
# ==========================================
|
||
|
|
# APK DOWNLOAD
|
||
|
|
# Serves the built APK for direct download,
|
||
|
|
# e.g. http://<host>/app-release.apk
|
||
|
|
# ==========================================
|
||
|
|
|
||
|
|
location / {
|
||
|
|
autoindex on;
|
||
|
|
try_files $uri $uri/ =404;
|
||
|
|
}
|
||
|
|
|
||
|
|
location ~ \.apk$ {
|
||
|
|
add_header Content-Disposition "attachment";
|
||
|
|
default_type application/vnd.android.package-archive;
|
||
|
|
}
|
||
|
|
|
||
|
|
# ==========================================
|
||
|
|
# BACKEND (handles /backend/ AND /<any-prefix>/backend/)
|
||
|
|
# ==========================================
|
||
|
|
|
||
|
|
location ~ ^/(?:[^/]+/)*backend/(.*)$ {
|
||
|
|
|
||
|
|
proxy_pass http://127.0.0.1:9292/$1$is_args$args;
|
||
|
|
|
||
|
|
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 Authorization $http_authorization;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|