Set up a reverse proxy
StackState Self-hosted v5.1.x
http {
server {
listen 80;
server_name _;
server_tokens off;
location /health {
return 200;
}
if ($http_x_forwarded_proto != "https") {
return 301 https://$host$request_uri;
}
location / {
proxy_pass http://localhost:7070;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Scheme $scheme;
proxy_set_header X-Forwarded-Proto https;
proxy_set_header X-Content-Type-Options nosniff;
proxy_set_header X-Frame-Options SAMEORIGIN;
proxy_set_header X-XSS-Protection "1; mode=block";
}
location /api/stream {
proxy_pass http://localhost:7070/api/stream;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Scheme $scheme;
proxy_set_header X-Forwarded-Proto https;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_set_header X-Content-Type-Options nosniff;
proxy_set_header X-Frame-Options SAMEORIGIN;
proxy_set_header X-XSS-Protection "1; mode=block";
}
location /api/telemetry {
proxy_pass http://localhost:7070/api/telemetry;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Scheme $scheme;
proxy_set_header X-Forwarded-Proto https;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_set_header X-Content-Type-Options nosniff;
proxy_set_header X-Frame-Options SAMEORIGIN;
proxy_set_header X-XSS-Protection "1; mode=block";
}
}
}Last updated