# Set up a reverse proxy

{% hint style="info" %}
StackState prefers Kubernetes!\
In the future we will move away from Linux support. Read how to [migrate from the Linux install of StackState to the Kubernetes install](/5.1/setup/install-stackstate/kubernetes_openshift/migrate_from_linux.md).
{% endhint %}

StackState makes heavy use of Websockets, so when setting up a reverse proxy to make StackState available on, for example, port 80 or 443 (with TLS) you will also need to proxy Websocket requests. An example setup for nginx for this looks like this (proxying port 80 to StackState running on localhost port 7070):

```
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";
        }
    }
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://archivedocs.stackstate.com/5.1/setup/install-stackstate/linux/reverse_proxy.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
