-
-
Notifications
You must be signed in to change notification settings - Fork 899
Nginx reverse proxy
Shuanglei Tao edited this page Feb 17, 2020
·
2 revisions
Example nginx conf for ttyd.
location / {
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_pass http://127.0.0.1:7681;
}
proxy ttyd under the /ttyd
path:
location ~ ^/ttyd(.*)$ {
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_pass http://127.0.0.1:7681/$1;
}
NOTE: This conf won't work fully with ttyd < 1.6.0, please use the latest version.