|
|
@ -98,21 +98,22 @@ The following configuration works for Apache (without HTTPS): |
|
|
|
|
|
|
|
|
|
|
|
### HAProxy |
|
|
|
### HAProxy |
|
|
|
|
|
|
|
|
|
|
|
The following configuration works for HAProxy (HTTPS with HTTP |
|
|
|
The following configuration works for HAProxy (HTTP and HTTPS): |
|
|
|
redirection): |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
```haproxy |
|
|
|
```haproxy |
|
|
|
frontend https |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
defaults |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Use HTTP protocole |
|
|
|
|
|
|
|
mode http |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
frontend https |
|
|
|
|
|
|
|
|
|
|
|
# Listen on the HTTPS and HTTP ports |
|
|
|
# Listen on the HTTPS and HTTP ports |
|
|
|
bind :80 |
|
|
|
bind :80 |
|
|
|
bind :443 ssl crt /etc/haproxy/cert_key.pem |
|
|
|
bind :443 ssl crt /etc/haproxy/certs/cert_key.pem |
|
|
|
|
|
|
|
|
|
|
|
# Some useful headers (Can be placed in the "default" section) |
|
|
|
# Bind URL with the right backend |
|
|
|
option httpclose |
|
|
|
|
|
|
|
option forwardfor |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Bind the URL with the right backend |
|
|
|
|
|
|
|
acl is_libresonic path_beg -i /libresonic |
|
|
|
acl is_libresonic path_beg -i /libresonic |
|
|
|
use_backend libresonic-backend if is_libresonic |
|
|
|
use_backend libresonic-backend if is_libresonic |
|
|
|
|
|
|
|
|
|
|
@ -122,6 +123,9 @@ backend libresonic-backend |
|
|
|
# proxy_redirect directive. |
|
|
|
# proxy_redirect directive. |
|
|
|
http-response replace-value Location ^http://(.*)$ https://\1 |
|
|
|
http-response replace-value Location ^http://(.*)$ https://\1 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# (OPTIONAL) Force HTTPS |
|
|
|
|
|
|
|
redirect scheme https if !{ ssl_fc } |
|
|
|
|
|
|
|
|
|
|
|
# Forward requests to Libresonic running on localhost on port 4040 |
|
|
|
# Forward requests to Libresonic running on localhost on port 4040 |
|
|
|
server libresonic 127.0.0.1:4040 check |
|
|
|
server libresonic 127.0.0.1:4040 check |
|
|
|
``` |
|
|
|
``` |
|
|
|