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:///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 //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; } } }