【发布时间】:2016-08-23 06:09:33
【问题描述】:
我知道如何使用 nginx 为 clojure web 应用程序设置 https。如何为凤凰做到这一点?
在prod.exs 我有这个:
config :my_app, MyApp.Endpoint,
url: [host: "my_website.com", port: 443],
http: [port: 4000],
# https: [port: 443,
# keyfile: System.get_env("SOME_APP_SSL_KEY_PATH"),
# certfile: System.get_env("SOME_APP_SSL_CERT_PATH")],
cache_static_manifest: "priv/static/manifest.json"
我有这个:
ssl_certificate: /etc/letsencrypt/live/my_app.com/fullchain.pem;
ssl_certificate_key: /etc/letsencrypt/live/my_app.com/privkey.pem;
我也想在 Phoenix 上使用 nginx。
1) 我应该从“prod.exs”中完全删除“http: [port: 4000]”吗?
2) 我应该取消注释 "https: [port: 443,...." 吗?或者我应该同时拥有它们?我不想通过 http 访问网站,否则我会让 nginx 通过将用户从 http 重定向到 https 来处理它。
3) 还是应该删除 https 和 http 让 nginx 处理?
4) 键“url”和它的“port”怎么样?
【问题讨论】:
标签: ssl nginx https elixir phoenix-framework