httpsms-gateway / nginx.hf.conf
ML Intern deploy
Deploy httpSMS gateway to Hugging Face Spaces (Docker SDK): nginx :7860 -> Go API :8000, Nuxt SPA, Android APK, bootstrap-mode entrypoint
83a59ca
Raw History Blame
1.87 kB
worker_processes 1;
pid /tmp/nginx.pid;
error_log /var/log/nginx/error.log warn;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
# All temp paths under /tmp so non-root uid=1000 never hits permission errors
client_body_temp_path /tmp/nginx_client_body;
proxy_temp_path /tmp/nginx_proxy;
fastcgi_temp_path /tmp/nginx_fastcgi;
uwsgi_temp_path /tmp/nginx_uwsgi;
scgi_temp_path /tmp/nginx_scgi;
sendfile on;
tcp_nopush on;
keepalive_timeout 65;
server_tokens off;
upstream httpsms_api {
server 127.0.0.1:8000;
}
server {
listen 7860;
server_name _;
access_log /var/log/nginx/access.log;
# Go Fiber API: /v1/* plus heartbeat/health routes (WebSocket/SSE aware)
location ~* ^/(v1|heartbeat|health)(/|$) {
proxy_pass http://httpsms_api;
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 https;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_read_timeout 3600s;
}
# Android APK direct download
location = /HttpSms.apk {
alias /usr/share/nginx/html/HttpSms.apk;
default_type application/vnd.android.package-archive;
add_header Content-Disposition 'attachment; filename="HttpSms.apk"';
}
# Nuxt static SPA with client-side routing fallback
location / {
root /usr/share/nginx/html;
try_files $uri $uri/ /index.html;
}
}
}