sweet-tooth-clojure.clojure-uberjar-webapp-nginx

角色名称

该角色配置一个 nginx 服务器,以反向代理应用服务器。它包含 ssl 和无 ssl 的 nginx 配置。

请参见 https://github.com/sweet-tooth-clojure/ansible-roles 以获取快速概述和说明。请参考 部署你的第一个 Clojure 应用 ...阴影中的 作为 Ansible 的入门指南,以及对该角色的深入解释。

要求

角色变量

我尽量将尽可能多的内容参数化,但设定了一些默认值,以便您只需要定义几个变量就能让一切正常工作。如果您定义了 clojure_uberjar_webapp_app_name,那么 flyingmachine.clojure-uberjar-webapp-common 将定义 clojure_uberjar_webapp_app_name,该变量被下面大多数变量使用。

例如,如果您的域名是 foo.bar.com,则应用名称将是 foo-bar-com。您的应用网站配置将上传到 _/etc/nginx/sites_available/foo-bar-com.conf_,您将在 /var/log/nginx/foo-bar-com.access.log 下找到日志。我发现这种一致性使得浏览文件系统更加方便。

虽然有些变量提到了 datomic,但它们是可选的。我希望改进该角色,使其不再包含对 datomic 的引用。

变量 描述
clojure_uberjar_webapp_nginx_dir 包含 nginx 配置的目录
clojure_uberjar_webapp_nginx_server_name 用于设置 nginx 网站配置中的 server_name;默认为 clojure_uberjar_webapp_domain
clojure_uberjar_webapp_nginx_upstream_name 在配置中引用 java 应用上游的名称
clojure_uberjar_webapp_nginx_sites_available nginx 的 sites_available 目录的路径;主要用于避免重复
clojure_uberjar_webapp_nginx_sites_enabled nginx 的 sites_enabled 目录的路径;主要用于避免重复
clojure_uberjar_webapp_nginx_static_location 提供静态文件的 URL 基础,例如 http://foo.com/static/logo.png 应提供静态文件
clojure_uberjar_webapp_nginx_static_alias 在服务器文件系统中查找静态文件的位置
clojure_uberjar_webapp_nginx_use_ssl 设置为 True 以使用 ssl
clojure_uberjar_webapp_nginx_letsencrypt_dir letsencrypt 文件所在的目录
clojure_uberjar_webapp_nginx_additional_config 附加到网站 nginx 配置文件末尾

依赖

示例剧本

---
- hosts: webservers
  become: true
  become_method: sudo
  roles:
    - "sweet-tooth-clojure.clojure-uberjar-webapp-common"
    - "sweet-tooth-clojure.clojure-uberjar-webapp-nginx"
    - "sweet-tooth-clojure.clojure-uberjar-webapp-datomic-free"
    - "sweet-tooth-clojure.clojure-uberjar-webapp-app"

许可证

MIT

作者信息

Daniel Higginbotham

关于项目

Run an uberjar web app

安装
ansible-galaxy install sweet-tooth-clojure.clojure-uberjar-webapp-nginx
许可证
Unknown
下载
402