-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
79 additions
and
58 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
|
||
- name: Install Caddy www server | ||
hosts: wwwhost | ||
# assumes you have static files at /app/www/ | ||
|
||
vars_files: | ||
- vars.yml | ||
|
||
tasks: | ||
- name: Install Caddy | ||
ansible.builtin.apt: | ||
pkg: | ||
- caddy | ||
|
||
- name: Copy our caddy config | ||
ansible.builtin.copy: | ||
src: "{{ src_folder }}/conf/caddy.conf" | ||
dest: /etc/caddy/Caddyfile | ||
owner: root | ||
group: root | ||
mode: u=rw,g=r,o=r | ||
|
||
- name: Restart caddy | ||
ansible.builtin.systemd_service: | ||
state: restarted | ||
name: caddy |
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 |
---|---|---|
|
@@ -9,3 +9,6 @@ | |
|
||
[dbhost] | ||
10.10.10.10 ansible_ssh_user=root | ||
|
||
[wwwhost] | ||
10.10.10.10 ansible_ssh_user=root |
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,32 @@ | ||
# The Caddyfile is an easy way to configure your Caddy web server. | ||
# | ||
# Unless the file starts with a global options block, the first | ||
# uncommented line is always the address of your site. | ||
# | ||
# To use your own domain name (with automatic HTTPS), first make | ||
# sure your domain's A/AAAA DNS records are properly pointed to | ||
# this machine's public IP, then replace ":80" below with your | ||
# domain name. | ||
|
||
:80 { | ||
# Set this path to your site's directory. | ||
root * /app/www/ | ||
|
||
# Enable the static file server. | ||
file_server | ||
|
||
# Another common task is to set up a reverse proxy: | ||
# reverse_proxy localhost:8080 | ||
|
||
# Or serve a PHP site through php-fpm: | ||
# php_fastcgi localhost:9000 | ||
|
||
# forward to restpie3 | ||
handle_path /api/* { | ||
rewrite * /api{uri} | ||
reverse_proxy localhost:8110 | ||
} | ||
} | ||
|
||
# Refer to the Caddy docs for more information: | ||
# https://caddyserver.com/docs/caddyfile |
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,5 @@ | ||
<h1>RESTPie3 setup works!</h1> | ||
|
||
<p>This static index.html is served by Caddy from folder /app/www/</p> | ||
|
||
<p>Caddy works as a proxy for RESTPie3 running <a href="/api/list">here</a>.</p> |