12 lines
879 B
TeX
12 lines
879 B
TeX
\chapter{Apache Configuration}
|
|
\label{sample-httpd.conf}
|
|
For Apache HTTP Server 2.4.47 or newer, \command{mod\_proxy\_http} can forward WebSocket upgrades. Enable \command{mod\_proxy}, \command{mod\_proxy\_http}, \command{mod\_headers}, and the TLS modules. Place these directives in your HTTPS virtual host, with your hostname and certificates configured separately:
|
|
\begin{lstlisting}[caption={Apache forwarding directives}]
|
|
ProxyRequests Off
|
|
ProxyPreserveHost On
|
|
RequestHeader set X-Forwarded-Proto "https"
|
|
ProxyPass /portal/ http://127.0.0.1:8080/portal/ upgrade=websocket
|
|
ProxyPassReverse /portal/ http://127.0.0.1:8080/portal/
|
|
\end{lstlisting}
|
|
Redirect the HTTP site to HTTPS. Match proxy request limits and timeouts to the application. Consult \url{https://httpd.apache.org/docs/2.4/mod/mod_proxy_http.html} for the installed Apache version's upgrade handling.
|