-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add haproxy, lighttpd, traefik, caddy * adjust nginx buffer sizes for way faster downloads * move unix-socket to /dev/shm/ because fedora sets PrivateTmp=true for nginx (orz)
- Loading branch information
Showing
8 changed files
with
165 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,29 @@ | ||
# when running copyparty behind a reverse proxy, | ||
# the following arguments are recommended: | ||
# if you would like to use unix-sockets (recommended), | ||
# you must run copyparty with one of the following: | ||
# | ||
# -i 127.0.0.1 only accept connections from nginx | ||
# -i unix:777:/dev/shm/party.sock | ||
# -i unix:777:/dev/shm/party.sock,127.0.0.1 | ||
# | ||
# if you are doing location-based proxying (such as `/stuff` below) | ||
# you must run copyparty with --rp-loc=stuff | ||
# | ||
# on fedora/rhel, remember to setsebool -P httpd_can_network_connect 1 | ||
|
||
|
||
LoadModule proxy_module modules/mod_proxy.so | ||
ProxyPass "/stuff" "http://127.0.0.1:3923/stuff" | ||
# do not specify ProxyPassReverse | ||
|
||
RequestHeader set "X-Forwarded-Proto" expr=%{REQUEST_SCHEME} | ||
# NOTE: do not specify ProxyPassReverse | ||
|
||
|
||
## | ||
## then, enable one of the below: | ||
|
||
# use subdomain proxying to unix-socket (best) | ||
ProxyPass "/" "unix:///dev/shm/party.sock|http://whatever/" | ||
|
||
# use subdomain proxying to 127.0.0.1 (slower) | ||
#ProxyPass "/" "http://127.0.0.1:3923/" | ||
|
||
# use subpath proxying to 127.0.0.1 (slow and maybe buggy) | ||
#ProxyPass "/stuff" "http://127.0.0.1:3923/stuff" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# this config is essentially two separate examples; | ||
# | ||
# foo1 connects to copyparty using tcp, and | ||
# foo2 uses unix-sockets for 27% higher performance | ||
# | ||
# to use foo2 you must run copyparty with one of the following: | ||
# | ||
# -i unix:777:/dev/shm/party.sock | ||
# -i unix:777:/dev/shm/party.sock,127.0.0.1 | ||
|
||
defaults | ||
mode http | ||
option forwardfor | ||
timeout connect 1s | ||
timeout client 610s | ||
timeout server 610s | ||
|
||
listen foo1 | ||
bind *:8081 | ||
server srv1 127.0.0.1:3923 maxconn 512 | ||
|
||
listen foo2 | ||
bind *:8082 | ||
server srv1 /dev/shm/party.sock maxconn 512 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# example usage for benchmarking: | ||
# | ||
# taskset -c 1 lighttpd -Df ~/dev/copyparty/contrib/lighttpd/subdomain.conf | ||
# | ||
# lighttpd can connect to copyparty using either tcp (127.0.0.1) | ||
# or a unix-socket, but unix-sockets are 37% faster because | ||
# lighttpd doesn't reuse tcp connections, so we're doing unix-sockets | ||
# | ||
# this means we must run copyparty with one of the following: | ||
# | ||
# -i unix:777:/dev/shm/party.sock | ||
# -i unix:777:/dev/shm/party.sock,127.0.0.1 | ||
# | ||
# on fedora/rhel, remember to setsebool -P httpd_can_network_connect 1 | ||
|
||
server.port = 80 | ||
server.document-root = "/var/empty" | ||
server.upload-dirs = ( "/dev/shm", "/tmp" ) | ||
server.modules = ( "mod_proxy" ) | ||
proxy.forwarded = ( "for" => 1, "proto" => 1 ) | ||
proxy.server = ( "" => ( ( "host" => "/dev/shm/party.sock" ) ) ) | ||
|
||
# if you really need to use tcp instead of unix-sockets, do this instead: | ||
#proxy.server = ( "" => ( ( "host" => "127.0.0.1", "port" => "3923" ) ) ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# example usage for benchmarking: | ||
# | ||
# taskset -c 1 lighttpd -Df ~/dev/copyparty/contrib/lighttpd/subpath.conf | ||
# | ||
# lighttpd can connect to copyparty using either tcp (127.0.0.1) | ||
# or a unix-socket, but unix-sockets are 37% faster because | ||
# lighttpd doesn't reuse tcp connections, so we're doing unix-sockets | ||
# | ||
# this means we must run copyparty with one of the following: | ||
# | ||
# -i unix:777:/dev/shm/party.sock | ||
# -i unix:777:/dev/shm/party.sock,127.0.0.1 | ||
# | ||
# also since this example proxies a subpath instead of the | ||
# recommended subdomain-proxying, we must also specify this: | ||
# | ||
# --rp-loc files | ||
# | ||
# on fedora/rhel, remember to setsebool -P httpd_can_network_connect 1 | ||
|
||
server.port = 80 | ||
server.document-root = "/var/empty" | ||
server.upload-dirs = ( "/dev/shm", "/tmp" ) | ||
server.modules = ( "mod_proxy" ) | ||
$HTTP["url"] =~ "^/files" { | ||
proxy.forwarded = ( "for" => 1, "proto" => 1 ) | ||
proxy.server = ( "" => ( ( "host" => "/dev/shm/party.sock" ) ) ) | ||
|
||
# if you really need to use tcp instead of unix-sockets, do this instead: | ||
#proxy.server = ( "" => ( ( "host" => "127.0.0.1", "port" => "3923" ) ) ) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# ./traefik --experimental.fastproxy=true --entrypoints.web.address=:8080 --providers.file.filename=copyparty.yaml | ||
|
||
http: | ||
services: | ||
service-cpp: | ||
loadBalancer: | ||
servers: | ||
- url: "http://127.0.0.1:3923/" | ||
routers: | ||
my-router: | ||
rule: "PathPrefix(`/`)" | ||
service: service-cpp |