Configuring Teleport 13+ behind nginx as an HTTPS reverse proxy #26445
Replies: 5 comments 9 replies
-
Hi, thank you for your tutorial. The difference is that I use cloudflare and cloudflare universal SSL doesnt support sub sub domain Now I have a CORS preflight issue in browser's console :
I tried to add in teleport config app :
I have put in nginx
|
Beta Was this translation helpful? Give feedback.
-
Hey Guys, thanks a ton for all your questions and answers. I'm also fighting with a reverse proxy setup. I'm using the nginx proxy manager, since I'm not that skilled to use pure config-files. I got it working though... I read somewhere (I'm sorry I forgot the Website), to create the certificates within nginx proxy manager, copy them over to teleport and add the path within the teleport.yaml file - so it looks like this: version: v3
teleport:
nodename: teleport
data_dir: /var/lib/teleport
log:
output: stderr
severity: INFO
format:
output: text
ca_pin: ""
diag_addr: ""
auth_service:
enabled: "yes"
listen_addr: 0.0.0.0:3025
cluster_name: teleport.example.com
ssh_service:
enabled: "yes"
commands:
- name: hostname
command: [hostname]
period: 1m0s
proxy_service:
enabled: "yes"
web_listen_addr: 0.0.0.0:443
listen_addr: 0.0.0.0:3023
public_addr: teleport.example.com:443
tunnel_public_addr: teleport.example.com:3024
tunnel_listen_addr: 0.0.0.0:3024
peer_listen_addr: 0.0.0.0:3022
ssh_public_addr: teleport.example.com:3023
kube_listen_addr: 0.0.0.0:3026
kube_public_addr: teleport.example.com:3026
https_keypairs:
- key_file: /var/lib/teleport/privkey.pem
cert_file: /var/lib/teleport/fullchain.pem
https_keypairs_reload_interval: 0s
acme: {} so what I (also) did was:
I created one entry in nginx proxy manager just for teleport.example.com:
Please note that this file is created by nginx proxy manager itself - I just cut out empty lines. Then I added another one for the wildcard with no certificate yet:
Caveats:
Feel free to add your two cents to this since my solution is far from perfect :) |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
Thanks Webvictim, so in my case, where I want to utilize the App-Section for many Services, wildcard is the only real option. This didn't change with teleport 13.0 upward, right? The change from that version on is, that a reverse proxy-szenario is supported by default, like you said here |
Beta Was this translation helpful? Give feedback.
-
After some work I got this to work for applications. The Problem I am facing now is the following: it works only for applications that run on http. Some of my applications run on https with a self signed cert. These do not work. Any Idea how to get them to work? |
Beta Was this translation helpful? Give feedback.
-
Here's how to configure Teleport 13+ behind
nginx
as an HTTPS reverse proxy.Notes:
teleport.example.com
with your own public domain.teleport.example.com
, pointing to the external IP address of your nginx server*.teleport.example.com
pointing to the external IP address of your nginx server if you want to use Teleport application accessIf you're using Cloudflare, your DNS records must be set to "DNS only" rather than "proxied"EDIT: Since version 15.1, Teleport uses regular websocket upgrades which work fine with Cloudflare proxying. However, Application Access subdomains should remain unproxied ("DNS only") unless you're using Advanced Certificate Manager.certbot
which you can supply to nginx:sudo certbot certonly -d teleport.example.com
sudo certbot certonly -d teleport.example.com,*.teleport.example.com --dns-route53
certbot renew
at least every 90 daysnginx
to read the updated certificates when this is done.certbot
.tsh
version 13+ installed locally.tsh
, commands liketsh login
will not work as expected. Check your version withtsh version
and upgrade if necessary./etc/teleport.yaml
:/etc/nginx/conf.d/teleport.conf
:Once these files are in place, start Teleport with
sudo systemctl start teleport
or similar, then start nginx withsudo systemctl start nginx
.sudo journalctl -u teleport -f
.sudo tail -F /var/log/nginx/access.log
If you have any issues, post comments here for assistance. We'd also love to hear if you just get it working!
Beta Was this translation helpful? Give feedback.
All reactions