mirror of
https://github.com/livebook-dev/livebook.git
synced 2024-09-20 01:55:56 +08:00
Add docs on how to use Nginx as a HTTPS proxy (#2735)
Co-authored-by: José Valim <jose.valim@dashbit.co>
This commit is contained in:
parent
2b0193078f
commit
f9606d7638
45
docs/deployment/nginx_https.md
Normal file
45
docs/deployment/nginx_https.md
Normal file
|
@ -0,0 +1,45 @@
|
||||||
|
# Nginx over HTTPS
|
||||||
|
|
||||||
|
This guide shows you how to use Nginx to serve Livebook over HTTPS.
|
||||||
|
|
||||||
|
## Prerequisites
|
||||||
|
|
||||||
|
- Nginx installed
|
||||||
|
- Livebook installed
|
||||||
|
- Both Livebook and Nginx running on the same machine or within the same network
|
||||||
|
- SSL certificate and key files
|
||||||
|
|
||||||
|
## Nginx configuration
|
||||||
|
|
||||||
|
Use the following Nginx config file as a starting point:
|
||||||
|
|
||||||
|
```nginx
|
||||||
|
http {
|
||||||
|
server {
|
||||||
|
listen 443 ssl;
|
||||||
|
server_name your_domain; # e.g., livebook.example.com
|
||||||
|
|
||||||
|
ssl_certificate /path/to/your/ssl_certificate.crt; # e.g., /etc/nginx/ssl/livebook.crt
|
||||||
|
ssl_certificate_key /path/to/your/ssl_certificate.key; # e.g., /etc/nginx/ssl/livebook.key
|
||||||
|
|
||||||
|
location / {
|
||||||
|
proxy_pass http://livebook_ip:livebook_port; # e.g., http://172.20.0.3:8080 (Livebook's default port is 8080)
|
||||||
|
proxy_http_version 1.1;
|
||||||
|
proxy_set_header Upgrade $http_upgrade;
|
||||||
|
proxy_set_header Connection "upgrade";
|
||||||
|
proxy_set_header Host $host;
|
||||||
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
|
proxy_set_header X-Forwarded-Proto $scheme;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
server {
|
||||||
|
listen 80;
|
||||||
|
server_name your_domain; # e.g., livebook.example.com
|
||||||
|
return 301 https://$host$request_uri;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
events {}
|
||||||
|
```
|
1
mix.exs
1
mix.exs
|
@ -248,6 +248,7 @@ defmodule Livebook.MixProject do
|
||||||
"docs/deployment/docker.md",
|
"docs/deployment/docker.md",
|
||||||
"docs/deployment/clustering.md",
|
"docs/deployment/clustering.md",
|
||||||
"docs/deployment/fips.md",
|
"docs/deployment/fips.md",
|
||||||
|
"docs/deployment/nginx_https.md",
|
||||||
"docs/teams/intro_to_teams.md",
|
"docs/teams/intro_to_teams.md",
|
||||||
"docs/teams/shared_secrets.md",
|
"docs/teams/shared_secrets.md",
|
||||||
"docs/teams/shared_file_storages.md",
|
"docs/teams/shared_file_storages.md",
|
||||||
|
|
Loading…
Reference in a new issue