Jumpserver#Jumpserver堡垒机部署

   日期:2020-11-02     浏览:98    评论:0    
核心提示:跳板机的作用:保障网络和数据不受来自外部和内部用户的入侵和破坏堡垒机的功能:登陆功能、账号管理、身份认证、资源授权、访问控制

文章目录

  • jumpserver跳板机部署
  • 一:环境部署
    • 1.关闭防火墙和selinux,修改字符集
    • 2.修改字符集,否则可能报 input/output error的问题,因为日志里打印了中文
  • 二:部署安装
    • 1、安装python3.6,数据库mariadb和redis以及环境准备
    • 2、启动数据库和redis服务
    • 3、数据库部署
    • 4、创建Python虚拟环境
    • 5、安装配置Jumpserver
    • 6、安装部署KoKo组件
    • 7、部署guacamole
    • 8、部署lina
    • 9、部署luna
    • 11、开始使用jumpserver
  • 三、解决Jumpserver重启服务无法访问问题:
  • 四、使用扩展:
  • 五、附录配置文件
    • jumpserver的config.yml
    • koko的config.yml
    • nginx配置文件

jumpserver跳板机部署

硬件硬件配置: 1个CPU核心, 3G 内存, 50G 硬盘(最低)
操作系统: Linux 发行版 x86_64 centos 7
Python = 3.6.x
Mariadb Server ≥ 5.5.56 数据库服务
Redis 数据库缓存服务
1台服务器(jumpserver)
1-n 台服务器(server)

一:环境部署

备注:主机名,yum仓库,网络都要保证正常

1.关闭防火墙和selinux,修改字符集

[root@jumpserver ~]# systemctl stop firewalld
[root@jumpserver ~]# systemctl disable firewalld
[root@jumpserver ~]# sed -i ‘/^SELINUX=/c SELINUX=disabled’ /etc/selinux/config
[root@jumpserver ~]# setenforce 0

2.修改字符集,否则可能报 input/output error的问题,因为日志里打印了中文

[root@jumpserver ~]# localedef -c -f UTF-8 -i zh_CN zh_CN.UTF-8
[root@jumpserver ~]# export LC_ALL=zh_CN.UTF-8
[root@jumpserver ~]# echo ‘LANG=“zh_CN.UTF-8”’ > /etc/locale.conf

备注:export 声明一个变量为环境变量

二:部署安装

1、安装python3.6,数据库mariadb和redis以及环境准备

[root@jumpserver ~]# yum -y install python36 python36-devel redis mariadb mariadb-server wget mariadb-devel python-devel openldap-devel

python3:python36 python36-devel
mariadb:mariadb mariadb-server

2、启动数据库和redis服务

[root@jumpserver ~]# systemctl start mariadb redis
[root@jumpserver ~]# systemctl enable mariadb redis

3、数据库部署

默认root账户登陆是没有密码的
[root@jumpserver ~]# mysql -u root
创建一个数据库,并且指定这个数据库所使用的字符集为utf-8;
MariaDB [(none)]> create database jumpserver default charset ‘utf8’ collate ‘utf8_bin’;
Query OK, 1 row affected (0.00 sec)
授权 .是分隔符 代表数据库中的全部的表。授权jumpserver库和库中所有表的权限给本机的jumpserver,密码是weakPasswd
MariaDB [(none)]> grant all on jumpserver.
to ‘jumpserver’@‘127.0.0.1’ identified by ‘weakPassword’;
Query OK, 0 rows affected (0.00 sec)
刷新数据库使其生效
MariaDB [(none)]> flush privileges;
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> quit

4、创建Python虚拟环境

因为 CentOS 7 自带的是 Python2,而 Yum 等工具依赖原来的 Python,为了不扰乱原来的环境我们来使用 Python 虚拟环境
[root@jumpserver ~]# cd /opt/
[root@jumpserver opt]# python3.6 -m venv py3 //给/opt创建一个python虚拟环境
[root@jumpserver opt]# source /opt/py3/bin/activate
此项仅为懒癌晚期的人员使用,防止运行 Jumpserver 时忘记载入 Python 虚拟环境导致程序无法运行。使用autoenv因为每次操作Jumpserver都要载入py3环境
(py3) [root@jumpserver opt]# echo “source /opt/py3/bin/activate” >> ~/.bashrc
(py3) [root@jumpserver opt]# source ~/.bashrc
//source 是让文件立即生效,每次运行都可以自动加载py3环境

5、安装配置Jumpserver

(py3) [root@jumpserver opt]# cd /opt && wget https://github.com/jumpserver/jumpserver/releases/download/v2.0.2/jumpserver-v2.0.2.tar.gz
解压,改名
(py3) [root@jumpserver opt]# tar xf jumpserver-v2.0.2.tar.gz
(py3) [root@jumpserver opt]# mv jumpserver-v2.0.2 jumpserver

添加虚拟环境
(py3) [root@jumpserver opt]# echo “source /opt/py3/bin/activate” > /opt/jumpserver/.env
安装依赖包
(py3) [root@jumpserver opt]# cd /opt/jumpserver/requirements/
安装rpm包的依赖
(py3) [root@jumpserver requirements]# yum install -y $(cat rpm_requirements.txt)

修改pip仓库:加快安装速度
方法一:
(py3) [root@jumpserver requirements]# vim /opt/py3/pip.conf
把下面的四行内容加进去

[global]
index-url = https://pypi.tuna.tsinghua.edu.cn/simple
[install]
trusted-host = https://pypi.tuna.tsinghua.edu.cn

(py3) [root@jumpserver requirements]# pip install wheel &&
pip install --upgrade pip setuptools &&
pip install -r requirements.txt

如果出现 time out 继续执行上一条命令,直到安装成功

=============================
修改配置文件:(配置文件见子目)
(py3) [root@jumpserver requirements]# cd /opt/jumpserver && cp config_example.yml config.yml &&vi config.yml
修改以下内容
SECRET_KEY: W5Ic3fMXNZ0p5RIy5DhJYJllppTfcfkW8Yuf94VBMfpcssbfu
BOOTSTRAP_TOKEN: zxffNymGjP79j6BN
DEBUG: false
LOG_LEVEL: ERROR
SESSION_EXPIRE_AT_BROWSER_CLOSE: true
DB_ENGINE: mysql
DB_HOST: 127.0.0.1
DB_PORT: 3306
DB_USER: jumpserver
DB_PASSWORD: weakPassword
DB_NAME: jumpserver
HTTP_BIND_HOST: 0.0.0.0
HTTP_LISTEN_PORT: 8080
WS_LISTEN_PORT: 8070
REDIS_HOST: 127.0.0.1
REDIS_PORT: 6379
WINDOWS_SKIP_ALL_MANUAL_PASSWORD: True

加载虚拟环境并后台启动
(py3) [root@jumpserver jumpserver]# source /opt/py3/bin/activate
(py3) [root@jumpserver jumpserver]# ./jms start -d

这里补充一个诡异的错误和解决的方法:
问题:授权完全没有问题,数据库就是连接不上
(py3) [root@jumpserver jumpserver]# mysql -ujumpserver -pweakPassword
ERROR 1045 (28000): Access denied for user ‘jumpserver’@‘localhost’ (using password: YES)
问题分析:就是你有一个用户名为空的账户,mysql会先匹配它,然后就一直提示你密码错误,删掉这个匿名用户,然后执行 FLUSH PRIVILEGES;
解决方法:
Delete FROM user Where User=’’ and Host=‘localhost’;

flush privileges;

6、安装部署KoKo组件

(py3) [root@jumpserver jumpserver]# cd /opt && wget https://github.com/jumpserver/koko/releases/download/v2.0.2/koko-v2.0.2-linux-amd64.tar.gz

(py3) [root@jumpserver opt]# tar xf koko-v2.0.2-linux-amd64.tar.gz
(py3) [root@jumpserver opt]# mv koko-v2.0.2-linux-amd64 koko
(py3) [root@jumpserver opt]# chown -R root:root koko && cd koko

修改配置文件(见子目录)
修改koko配置文件(见笔记)
(py3) [root@jumpserver koko]# ls
config_example.yml data koko locale static templates
(py3) [root@jumpserver koko]# vim config_example.yml //全部删除,复制黏贴

启动
(py3) [root@jumpserver koko]# ./koko -d

7、部署guacamole

下载:
(py3) [root@jumpserver opt]# cd /opt && wget -O /opt/guacamole.tar.gz https://github.com/jumpserver/docker-guacamole/archive/2.0.2.tar.gz
部署:
(py3) [root@jumpserver opt]# tar -xf docker-guacamole-2.0.2.tar.gz && mv docker-guacamole-2.0.2 guacamole && cd /opt/guacamole && tar -xf guacamole-server-1.2.0.tar.gz && tar -xf ssh-forward.tar.gz -C /bin/ && chmod +x /bin/ssh-forward

安装:
(py3) [root@jumpserver guacamole]# cd /opt/guacamole/guacamole-server-1.2.0
注意:这个地方如果单独执行编译安装会报错需要事先准备好下面的编译环境在安装
[root@jumpserver guacamole-server-1.2.0]# yum -y install libjpeg-devel libpng-devel libvorbis-devel libwebp-devel openssl-devel pulseaudio-libs-devel libwebsockets-devel libvncserver-devel libtelnet-devel libssh2-devel pango-devel freerdp-devel uuid uuid-devel
(py3) [root@jumpserver guacamole-server-1.2.0]# ./configure --with-init-dir=/etc/init.d &&
make &&
make install

注意:这个地方如果单独执行编译安装会报错需要事先准备好下面的编译环境在安装
[root@jumpserver guacamole-server-1.2.0]# yum -y install libjpeg-devel libpng-devel libvorbis-devel libwebp-devel openssl-devel pulseaudio-libs-devel libwebsockets-devel libvncserver-devel libtelnet-devel libssh2-devel pango-devel freerdp-devel uuid uuid-devel
jdk+tomcat

安装java环境
(py3) [root@jumpserver guacamole-server-1.2.0]# yum install -y java-1.8.0-openjdk

创建对应目录
(py3) [root@jumpserver guacamole-server-1.2.0]# mkdir -p /config/guacamole /config/guacamole/extensions /config/guacamole/record /config/guacamole/drive && chown daemon:daemon /config/guacamole/record /config/guacamole/drive && cd /config

部署tomcat
(py3) [root@jumpserver config]# wget http://mirrors.tuna.tsinghua.edu.cn/apache/tomcat/tomcat-9/v9.0.36/bin/apache-tomcat-9.0.36.tar.gz

(py3) [root@jumpserver config]# tar -xf apache-tomcat-9.0.36.tar.gz &&
mv apache-tomcat-9.0.36 tomcat9 &&
rm -rf /config/tomcat9/webapps/* &&
sed -i ‘s/Connector port=“8080”/Connector port=“8081”/g’ /config/tomcat9/conf/server.xml &&
echo “java.util.logging.ConsoleHandler.encoding = UTF-8” >> /config/tomcat9/conf/logging.properties &&
ln -sf /opt/guacamole/guacamole-1.0.0.war /config/tomcat9/webapps/ROOT.war &&
ln -sf /opt/guacamole/guacamole-auth-jumpserver-1.0.0.jar /config/guacamole/extensions/guacamole-auth-jumpserver-1.0.0.jar &&
ln -sf /opt/guacamole/root/app/guacamole/guacamole.properties /config/guacamole/guacamole.properties

设置guacamole环境

(py3) [root@jumpserver config]# vim a.sh
(py3) [root@jumpserver config]# bash a.sh
vim a.sh
bash a.sh

export JUMPSERVER_SERVER=http://127.0.0.1:8080
echo “export JUMPSERVER_SERVER=http://127.0.0.1:8080” >> ~/.bashrc
export BOOTSTRAP_TOKEN=zxffNymGjP79j6BN
echo “export BOOTSTRAP_TOKEN=zxffNymGjP79j6BN” >> ~/.bashrc
export JUMPSERVER_KEY_DIR=/config/guacamole/keys
echo “export JUMPSERVER_KEY_DIR=/config/guacamole/keys” >> ~/.bashrc
export GUACAMOLE_HOME=/config/guacamole
echo “export GUACAMOLE_HOME=/config/guacamole” >> ~/.bashrc
export GUACAMOLE_LOG_LEVEL=ERROR
echo “export GUACAMOLE_LOG_LEVEL=ERROR” >> ~/.bashrc
export JUMPSERVER_ENABLE_DRIVE=true
echo “export JUMPSERVER_ENABLE_DRIVE=true” >> ~/.bashrc
说明:
JUMPSERVER_SERVER 指 core 访问地址
BOOTSTRAP_TOKEN 为 Jumpserver/config.yml 里面的 BOOTSTRAP_TOKEN 值
JUMPSERVER_KEY_DIR 认证成功后 key 存放目录
GUACAMOLE_HOME 为 guacamole.properties 配置文件所在目录
GUACAMOLE_LOG_LEVEL 为生成日志的等级
JUMPSERVER_ENABLE_DRIVE 为 rdp 协议挂载共享盘

启动guacamole
(py3) [root@jumpserver config]# /etc/init.d/guacd start
Starting guacd: guacd[72995]: INFO: Guacamole proxy daemon (guacd) version 1.2.0 started
SUCCESS
(py3) [root@jumpserver config]# sh /config/tomcat9/bin/startup.sh
Using CATALINA_BASE: /config/tomcat9
Using CATALINA_HOME: /config/tomcat9
Using CATALINA_TMPDIR: /config/tomcat9/temp
Using JRE_HOME: /usr
Using CLASSPATH: /config/tomcat9/bin/bootstrap.jar:/config/tomcat9/bin/tomcat-juli.jar
Tomcat started.

8、部署lina

(py3) [root@jumpserver config]# cd /opt && wget https://github.com/jumpserver/lina/releases/download/v2.0.2/lina-v2.0.2.tar.gz

(py3) [root@jumpserver opt]# tar -xf lina-v2.0.2.tar.gz
(py3) [root@jumpserver opt]# mv lina-v2.0.2 lina

9、部署luna

(py3) [root@jumpserver config]# cd /opt && wget https://github.com/jumpserver/luna/releases/download/v2.0.2/luna-v2.0.2.tar.gz

(py3) [root@jumpserver opt]# tar -xf luna-v2.0.2.tar.gz
(py3) [root@jumpserver opt]# mv luna-v2.0.2 luna

10、安装nginx
nginx的yum仓库文件:
(py3) [root@jumpserver opt]# cat /etc/yum.repos.d/nginx.repo
[nginx-stable]
name=nginx stable repo
baseurl=http://nginx.org/packages/centos/ r e l e a s e v e r / releasever/ releasever/basearch/
gpgcheck=1
enabled=1
gpgkey=https://nginx.org/keys/nginx_signing.key
module_hotfixes=true

(py3) [root@jumpserver opt]# yum -y install nginx

修改配置文件:(内容见子目录)
(py3) [root@jumpserver opt]# echo > /etc/nginx/conf.d/default.conf
(py3) [root@jumpserver opt]# vi /etc/nginx/conf.d/jumpserver.conf

启动nginx:
(py3) [root@jumpserver opt]# systemctl start nginx
(py3) [root@jumpserver ~]# systemctl enable nginx

11、开始使用jumpserver

服务全部启动后, 访问 JumpServer 服务器 nginx 代理的 80 端口, 不要通过8080端口访问 默认账号: admin 密码: admin

三、解决Jumpserver重启服务无法访问问题:

(py3) [root@jumpserver ~]# vim /etc/rc.d/rc.local
cd /opt/jumpserver && ./jms start -d
cd /opt/koko && ./koko -d
(py3) [root@jumpserver ~]# chmod a+x /etc/rc.d/rc.local

四、使用扩展:

安装可以使ansible使用密码连接
yum -y install sshpass

管理用户: 是资产(被控服务器)上的 root,他要获取资产(被控服务器)的硬件信息,还要将系统用户推送给资产(被控服务器)
系统用户: 自己创建,JumpServer 跳转登录资产时使用的用户

简单来说是用户使用自己的用户名登录 JumpServer,JumpServer 使用系统用户登录资产。系统用户创建时,如果选择了自动推送,JumpServer 会使用 Ansible 自动推送系统用户到资产中,如果资产(交换机)不支持 Ansible,请手动填写账号密码

终端连接jumpserver
[root@yumanzhuang ~]# ssh admin@10.11.65.100 -p 2222

五、附录配置文件

jumpserver的config.yml

# SECURITY WARNING: keep the secret key used in production secret!
# 加密秘钥 生产环境中请修改为随机字符串,请勿外泄, 可使用命令生成
# cat /dev/urandom | tr -dc A-Za-z0-9 | head -c 49;echo
SECRET_KEY: W5Ic3fMXNZ0p5RIy5DhJYJllppTfcfkW8Yuf94VBMfpcssbfu

# SECURITY WARNING: keep the bootstrap token used in production secret!
# 预共享Token coco和guacamole用来注册服务账号,不在使用原来的注册接受机制
BOOTSTRAP_TOKEN: zxffNymGjP79j6BN

# Development env open this, when error occur display the full process track, Production disable it
# DEBUG 模式 开启DEBUG后遇到错误时可以看到更多日志
DEBUG: false

# DEBUG, INFO, WARNING, ERROR, CRITICAL can set. See https://docs.djangoproject.com/en/1.10/topics/logging/
# 日志级别
LOG_LEVEL: ERROR
# LOG_DIR:

# Session expiration setting, Default 24 hour, Also set expired on on browser close
# 浏览器Session过期时间,默认24小时, 也可以设置浏览器关闭则过期
# SESSION_COOKIE_AGE: 86400
SESSION_EXPIRE_AT_BROWSER_CLOSE: true

# Database setting, Support sqlite3, mysql, postgres ....
# 数据库设置
# See https://docs.djangoproject.com/en/1.10/ref/settings/#databases

# SQLite setting:
# 使用单文件sqlite数据库
# DB_ENGINE: sqlite3
# DB_NAME:

# MySQL or postgres setting like:
# 使用Mysql作为数据库
DB_ENGINE: mysql
DB_HOST: 127.0.0.1
DB_PORT: 3306
DB_USER: jumpserver
DB_PASSWORD: weakPassword
DB_NAME: jumpserver

# When Django start it will bind this host and port
# ./manage.py runserver 127.0.0.1:8080
# 运行时绑定端口
HTTP_BIND_HOST: 0.0.0.0
HTTP_LISTEN_PORT: 8080
WS_LISTEN_PORT: 8070

# Use Redis as broker for celery and web socket
# Redis配置
REDIS_HOST: 127.0.0.1
REDIS_PORT: 6379
#REDIS_PASSWORD: 
# REDIS_DB_CELERY: 3
# REDIS_DB_CACHE: 4

# Use OpenID authorization
# 使用OpenID 来进行认证设置
# BASE_SITE_URL: http://localhost:8080
# AUTH_OPENID: false # True or False
# AUTH_OPENID_SERVER_URL: https://openid-auth-server.com/
# AUTH_OPENID_REALM_NAME: realm-name
# AUTH_OPENID_CLIENT_ID: client-id
# AUTH_OPENID_CLIENT_SECRET: client-secret
# AUTH_OPENID_IGNORE_SSL_VERIFICATION: True
# AUTH_OPENID_SHARE_SESSION: True

# Use Radius authorization
# 使用Radius来认证
# AUTH_RADIUS: false
# RADIUS_SERVER: localhost
# RADIUS_PORT: 1812
# RADIUS_SECRET:

# CAS 配置
# AUTH_CAS': False,
# CAS_SERVER_URL': "http://host/cas/",
# CAS_ROOT_PROXIED_AS': 'http://jumpserver-host:port', 
# CAS_LOGOUT_COMPLETELY': True,
# CAS_VERSION': 3,

# LDAP/AD settings
# LDAP 搜索分页数量
# AUTH_LDAP_SEARCH_PAGED_SIZE: 1000
#
# 定时同步用户
# 启用 / 禁用
# AUTH_LDAP_SYNC_IS_PERIODIC: True
# 同步间隔 (单位: 时) (优先)
# AUTH_LDAP_SYNC_INTERVAL: 12
# Crontab 表达式
# AUTH_LDAP_SYNC_CRONTAB: * 6 * * *
#
# LDAP 用户登录时仅允许在用户列表中的用户执行 LDAP Server 认证
# AUTH_LDAP_USER_LOGIN_ONLY_IN_USERS: False
#
# LDAP 认证时如果日志中出现以下信息将参数设置为 0 (详情参见:https://www.python-ldap.org/en/latest/faq.html)
# In order to perform this operation a successful bind must be completed on the connection
# AUTH_LDAP_OPTIONS_OPT_REFERRALS: -1

# OTP settings
# OTP/MFA 配置
# OTP_VALID_WINDOW: 0
# OTP_ISSUER_NAME: Jumpserver

# Perm show single asset to ungrouped node
# 是否把未授权节点资产放入到 未分组 节点中
# PERM_SINGLE_ASSET_TO_UNGROUP_NODE: false
#
# 启用定时任务
# PERIOD_TASK_ENABLE: True
#
# 启用二次复合认证配置
# LOGIN_CONFIRM_ENABLE: False
#
# Windows 登录跳过手动输入密码
WINDOWS_SKIP_ALL_MANUAL_PASSWORD: True

koko的config.yml

# 项目名称, 会用来向Jumpserver注册, 识别而已, 不能重复
# NAME: { { Hostname }}

# Jumpserver项目的url, api请求注册会使用
CORE_HOST: http://127.0.0.1:8080

# Bootstrap Token, 预共享秘钥, 用来注册coco使用的service account和terminal
# 请和jumpserver 配置文件中保持一致,注册完成后可以删除
BOOTSTRAP_TOKEN: zxffNymGjP79j6BN

# 启动时绑定的ip, 默认 0.0.0.0
# BIND_HOST: 0.0.0.0

# 监听的SSH端口号, 默认2222
# SSHD_PORT: 2222

# 监听的HTTP/WS端口号,默认5000
# HTTPD_PORT: 5000

# 项目使用的ACCESS KEY, 默认会注册,并保存到 ACCESS_KEY_STORE中,
# 如果有需求, 可以写到配置文件中, 格式 access_key_id:access_key_secret
# ACCESS_KEY: null

# ACCESS KEY 保存的地址, 默认注册后会保存到该文件中
# ACCESS_KEY_FILE: data/keys/.access_key

# 设置日志级别 [DEBUG, INFO, WARN, ERROR, FATAL, CRITICAL]
LOG_LEVEL: ERROR

# SSH连接超时时间 (default 15 seconds)
# SSH_TIMEOUT: 15

# 语言 [en,zh]
# LANG: zh

# SFTP的根目录, 可选 /tmp, Home其他自定义目录
# SFTP_ROOT: /tmp

# SFTP是否显示隐藏文件
# SFTP_SHOW_HIDDEN_FILE: false

# 是否复用和用户后端资产已建立的连接(用户不会复用其他用户的连接)
# REUSE_CONNECTION: true

# 资产加载策略, 可根据资产规模自行调整. 默认异步加载资产, 异步搜索分页; 如果为all, 则资产全部加载, 本地搜索分页.
# ASSET_LOAD_POLICY:

# zip压缩的最大额度 (单位: M)
# ZIP_MAX_SIZE: 1024M

# zip压缩存放的临时目录 /tmp
# ZIP_TMP_PATH: /tmp

# 向 SSH Client 连接发送心跳的时间间隔 (单位: 秒),默认为30, 0则表示不发送
# CLIENT_ALIVE_INTERVAL: 30

# 向资产发送心跳包的重试次数,默认为3
# RETRY_ALIVE_COUNT_MAX: 3

# 会话共享使用的类型 [local, redis], 默认local
SHARE_ROOM_TYPE: redis

# Redis配置
REDIS_HOST: 127.0.0.1
REDIS_PORT: 6379
#REDIS_PASSWORD: ZhYnLrodpmPncovxJTnRyiBs
# REDIS_CLUSTERS:
REDIS_DB_ROOM: 6

nginx配置文件

server { 
    listen 80;

    client_max_body_size 100m;  # 录像及文件上传大小限制

    location /ui/ { 
        try_files $uri / /index.html;
        alias /opt/lina/;
    }

    location /luna/ { 
        try_files $uri / /index.html;
        alias /opt/luna/;  # luna 路径, 如果修改安装目录, 此处需要修改
    }

    location /media/ { 
        add_header Content-Encoding gzip;
        root /opt/jumpserver/data/;  # 录像位置, 如果修改安装目录, 此处需要修改
    }

    location /static/ { 
        root /opt/jumpserver/data/;  # 静态资源, 如果修改安装目录, 此处需要修改
    }

    location /koko/ { 
        proxy_pass       http://localhost:5000;
        proxy_buffering off;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header Host $host;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        access_log off;
    }

    location /guacamole/ { 
        proxy_pass       http://localhost:8081/;
        proxy_buffering off;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection $http_connection;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header Host $host;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        access_log off;
    }

    location /ws/ { 
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header Host $host;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_pass http://localhost:8070;
        proxy_http_version 1.1;
        proxy_buffering off;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
    }

    location /api/ { 
        proxy_pass http://localhost:8080;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header Host $host;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    }

    location /core/ { 
        proxy_pass http://localhost:8080;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header Host $host;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    }

    location / { 
        rewrite ^/(.*)$ /ui/$1 last;
    }
}
 
打赏
 本文转载自:网络 
所有权利归属于原作者,如文章来源标示错误或侵犯了您的权利请联系微信13520258486
更多>最近资讯中心
更多>最新资讯中心
0相关评论

推荐图文
推荐资讯中心
点击排行
最新信息
新手指南
采购商服务
供应商服务
交易安全
关注我们
手机网站:
新浪微博:
微信关注:

13520258486

周一至周五 9:00-18:00
(其他时间联系在线客服)

24小时在线客服