> For the complete documentation index, see [llms.txt](https://docs.devolutions.net/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.devolutions.net/powershell-universal/it/config/hosting/reverse-proxy.md).

# Reverse proxy

I reverse proxy consentono di configurare funzionalità come TLS, riscrittura delle intestazioni, caching e bilanciamento del carico. Alcuni reverse proxy diffusi sono IIS, Apache e NGINX.

Ciascuno di questi sistemi acquisisce il traffico HTTP e lo inoltra a un server web di backend, come PowerShell Universal. Vi sono alcune considerazioni da tenere presenti quando si configura un reverse proxy davanti a PowerShell Universal.

## Supporto WebSocket

PowerShell Universal richiede il supporto WebSocket per fornire tutte le funzionalità disponibili nella piattaforma. Senza il supporto WebSocket, le app non funzioneranno e le notifiche non verranno presentate in tempo reale.

A seconda del proxy, potrebbe essere necessario configurare il supporto WebSocket.

* [Supporto del protocollo WebSocket in IIS](https://learn.microsoft.com/en-us/iis/get-started/whats-new-in-iis-8/iis-80-websocket-protocol-support)
* [Proxying WebSocket con NGINX](https://nginx.org/en/docs/http/websocket.html)

## Intestazioni inoltrate

Quando un server web si trova dietro un reverse proxy, è probabile che il nome host esterno, il protocollo e la porta differiscano da quelli del proxy stesso. Ad esempio, PowerShell Universal resterà in ascolto sulla porta 5000, su HTTP e in base a un indirizzo IP specifico (o loopback) anziché a un nome DNS.

```
https://www.proxyaddress.com -> http://localhost:5000
```

Ciò può causare problemi con i reindirizzamenti URL come quelli utilizzati nei flussi di autenticazione [OpenID Connect](/powershell-universal/it/sicurezza/enterprise-security/openid-connect.md). PowerShell Universal deve essere in grado di formulare correttamente l'URL di reindirizzamento per il flusso di autenticazione. Senza conoscere il nome host, la porta o il protocollo effettivamente utilizzati dall'utente finale, possono essere generati URL non validi che causano l'esito negativo del flusso.

Per impostazione predefinita, PowerShell Universal gestisce automaticamente le [intestazioni inoltrate](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Forwarded). Le seguenti intestazioni vengono elaborate automaticamente.

* X-Forwarded-For
* X-Forwarded-Host
* X-Forwarded-Proto

Ciò consente a PowerShell Universal di creare gli URL di reindirizzamento corretti per i flussi di autenticazione.

I reverse proxy possono richiedere una configurazione per inviare correttamente queste intestazioni.

* IIS configura automaticamente le intestazioni inoltrate.
* [Intestazioni inoltrate NGINX](https://www.nginx.com/resources/wiki/start/topics/examples/forwarded/)
* [Apache mod\_proxy](https://httpd.apache.org/docs/2.4/mod/mod_proxy.html#x-headers)
* [Intestazioni delle richieste HTTP di CloudFlare](https://developers.cloudflare.com/fundamentals/get-started/reference/http-request-headers/#x-forwarded-for)

## Azure Application Proxy

Azure Application Proxy, noto anche come Entra ID Private Network Connector, fornisce l'accesso alle risorse on premises tramite internet utilizzando la sicurezza fornita da Microsoft. Sarà necessario installare un connettore all'interno della sua rete per inoltrare tramite proxy la connessione a PowerShell Universal.

Configuri le impostazioni di Application Proxy per la sua applicazione aziendale, in modo che puntino al server locale. In questo esempio, al gruppo Default - North America è associato il mio connettore. In questa macchina connettore è installato PowerShell Universal.

<figure><img src="/files/o0B4KhK809VSipsgx3p7" alt=""><figcaption></figcaption></figure>

Per le impostazioni avanzate, utilizzi un cookie persistente ed eviti di tradurre qualsiasi URL. Se lo desidera, può scegliere se convalidare il certificato SSL di backend.

<figure><img src="/files/tM684m9Zm6sKx4GlPkBN" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.devolutions.net/powershell-universal/it/config/hosting/reverse-proxy.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
