参照https://ruby-china.org/topics/41129,修改 homeland-docker 的文件 etc/caddy/Caddyfile如下
@huacnlee 大佬帮忙看看
版本号如下:
$ sudo lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 18.04.5 LTS
Release: 18.04
Codename: bionic
aabbcc 是代替域名
方式一:
{$domain},www.{$domain}
reverse_proxy {
to web:80
}
app.local.env 配置文件如下:
app_name=aabbcc
domain=aabbcc.com
[email protected]
方式二:
{$domain}
reverse_proxy {
to web:80
}
app.local.env 配置文件如下:
app_name=aabbcc
domain=*.aabbcc.com
[email protected]
然后关掉服务后重启,查看状态正常,索引正常
$ sudo make stop-all
Stopping homeland_caddy ... done
Stopping homeland_web ... done
Stopping homeland_worker ... done
Stopping homeland_app ... done
Stopping homeland_app_backup ... done
Stopping homeland_postgresql ... done
Stopping homeland_redis ... done
Removing homelanddocker_app_run_2 ... done
Removing homelanddocker_app_run_1 ... done
Removing homeland_caddy ... done
Removing homeland_web ... done
Removing homeland_worker ... done
Removing homeland_app ... done
Removing homeland_app_backup ... done
Removing homeland_postgresql ... done
Removing homeland_redis ... done
Removing network homelanddocker_default
$ sudo make start
Creating network "homelanddocker_default" with the default driver
Creating homeland_redis ...
Creating homeland_postgresql ...
Creating homeland_postgresql
Creating homeland_redis ... done
Creating homeland_app ...
Creating homeland_app_backup ...
Creating homeland_worker ...
Creating homeland_app
Creating homeland_app_backup
Creating homeland_worker ... done
Creating homeland_web ...
Creating homeland_web ... done
Creating homeland_caddy ...
Creating homeland_caddy ... done
$ sudo make status
Name Command State Ports
-----------------------------------------------------------------------------------------------------------------------------------------------
homeland_app /home/app/homeland/bin/doc ... Up 0.0.0.0:49179->7000/tcp,:::49179->7000/tcp
homeland_app_backup bundle exec puma -C config ... Up 0.0.0.0:49178->7001/tcp,:::49178->7001/tcp
homeland_caddy caddy run --config /etc/ca ... Up 2019/tcp, 0.0.0.0:443->443/tcp,:::443->443/tcp, 0.0.0.0:80->80/tcp,:::80->80/tcp
homeland_postgresql docker-entrypoint.sh postgres Up 0.0.0.0:49176->5432/tcp,:::49176->5432/tcp
homeland_redis docker-entrypoint.sh redis ... Up 0.0.0.0:49177->6379/tcp,:::49177->6379/tcp
homeland_web /etc/nginx/start Up 0.0.0.0:8080->80/tcp,:::8080->80/tcp
homeland_worker bundle exec sidekiq -C con ... Up
$ sudo make reindex
Reindex Search...
Starting homeland_postgresql ...
Starting homeland_redis ... done
Reindexing topicsdone
Reindexing usersdone
域名解析正常
ssl 证书成功申请
两种方式都无法打开网站