Last active
April 12, 2022 13:24
-
-
Save zaidakram/3c38bed309bc6e2675b9b85d688e0073 to your computer and use it in GitHub Desktop.
[Caddy V1] Need to port this from V1 to V2 without breaking anything.
This file contains hidden or 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
| gzip | |
| tls support@app.com | |
| errors /var/log/caddy/error.log { | |
| rotate_size 10 | |
| rotate_keep 10 | |
| rotate_compress | |
| } | |
| log / /var/log/caddy/access.log "{combined} {hostonly} {latency_ms}" { | |
| rotate_size 10 | |
| rotate_keep 10 | |
| rotate_compress | |
| } |
This file contains hidden or 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
| app.com api.app.com docs.app.com admin.app.com business.app.com { | |
| gzip | |
| root /home/user/app.com/current/public | |
| rewrite { | |
| if {path} is / | |
| to /app-proxy/{uri} | |
| } | |
| rewrite { | |
| to index.html {path} /app-proxy/{uri} | |
| } | |
| proxy /app-proxy unix:/home/user/app.com/shared/tmp/sockets/puma.sock { | |
| without /app-proxy | |
| transparent | |
| } | |
| } | |
| :443 { | |
| import Caddycommon | |
| gzip | |
| root /home/user/app.com/current/public | |
| tls { | |
| # on-demand | |
| ask https://api.app.com/path/present.json | |
| } | |
| rewrite { | |
| if {path} is / | |
| to /app-proxy/{uri} | |
| } | |
| rewrite { | |
| to index.html {path} /app-proxy/{uri} | |
| } | |
| proxy /app-proxy unix:/home/user/app.com/shared/tmp/sockets/puma.sock { | |
| without /app-proxy | |
| transparent | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment