How do I serve a single static file from HAProxy? - Help! - HAProxy community
Last active
April 25, 2019 15:37
-
-
Save tksugimoto/12cf9949dcd89471ad952542458aa2d1 to your computer and use it in GitHub Desktop.
HAProxyで静的コンテンツ配信
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
.env |
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
HTTP/1.0 200 OK | |
Cache-Control: no-cache | |
Connection: close | |
Content-Type: text/plain | |
test |
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
version: '3' | |
services: | |
haproxy: | |
build: | |
context: ./ | |
ports: | |
- "${HAPROXY_BIND_IP_PORT:-127.0.0.1:8080}:80" |
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
FROM haproxy:1.9-alpine | |
COPY haproxy.cfg /usr/local/etc/haproxy/haproxy.cfg | |
COPY 200-test.http /etc/haproxy/errors/200-test.http |
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
frontend http-in | |
bind *:80 | |
default_backend static-file | |
backend static-file | |
mode http | |
errorfile 503 /etc/haproxy/errors/200-test.http |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment