Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
J
jumpserver
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ops
jumpserver
Commits
ced5db08
Commit
ced5db08
authored
Jul 13, 2018
by
wojiushixiaobai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改文档
parent
4311d2d3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
28 deletions
+23
-28
distributed_02.rst
docs/distributed_02.rst
+23
-28
No files found.
docs/distributed_02.rst
View file @
ced5db08
...
@@ -79,7 +79,17 @@
...
@@ -79,7 +79,17 @@
access_log /var/log/nginx/tcp-access.log proxy;
access_log /var/log/nginx/tcp-access.log proxy;
open_log_file_cache off;
open_log_file_cache off;
include /etc/nginx/conf.d/*.stream;
upstream cocossh {
server 192.168.100.12:2222;
# server ip:port max_fails=1 fail_timeout=120s;
# 这里是 coco ssh 的后端ip ,max_fails=1 fail_timeout=120s 是 HA 参数
}
server {
listen 2222;
proxy_pass cocossh;
proxy_connect_timeout 10s;
proxy_timeout 24h; #代理超时
}
}
}
http {
http {
...
@@ -93,14 +103,14 @@
...
@@ -93,14 +103,14 @@
access_log /var/log/nginx/access.log main;
access_log /var/log/nginx/access.log main;
sendfile on;
sendfile on;
#tcp_nopush on;
#
tcp_nopush on;
keepalive_timeout 65;
keepalive_timeout 65;
#关闭版本显示
#
关闭版本显示
server_tokens off;
server_tokens off;
#gzip 压缩传输
#
gzip 压缩传输
gzip on;
gzip on;
gzip_min_length 1k;
gzip_min_length 1k;
gzip_buffers 4 16k;
gzip_buffers 4 16k;
...
@@ -109,7 +119,7 @@
...
@@ -109,7 +119,7 @@
gzip_types text/plain application/x-javascripttext/css application/xml;
gzip_types text/plain application/x-javascripttext/css application/xml;
gzip_vary on;
gzip_vary on;
#
配置代理参数
#
配置代理参数:
proxy_redirect off;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Real-IP $remote_addr;
...
@@ -119,7 +129,7 @@
...
@@ -119,7 +129,7 @@
proxy_send_timeout 90;
proxy_send_timeout 90;
proxy_buffer_size 4k;
proxy_buffer_size 4k;
#缓存配置
#
缓存配置
proxy_temp_file_write_size 264k;
proxy_temp_file_write_size 264k;
proxy_temp_path /var/cache/nginx/nginx_temp;
proxy_temp_path /var/cache/nginx/nginx_temp;
proxy_cache_path /var/cache/nginx/nginx_cache levels=1:2 keys_zone=cache_one:200m inactive=5d max_size=400m;
proxy_cache_path /var/cache/nginx/nginx_cache levels=1:2 keys_zone=cache_one:200m inactive=5d max_size=400m;
...
@@ -130,6 +140,9 @@
...
@@ -130,6 +140,9 @@
::
::
# 备份默认的配置文件
$ mv /etc/nginx/conf.d/default.conf /etc/nginx/conf.d/default.bak
$ vim /etc/nginx/conf.d/jumpserver.conf
$ vim /etc/nginx/conf.d/jumpserver.conf
upstream jumpserver {
upstream jumpserver {
...
@@ -152,13 +165,11 @@
...
@@ -152,13 +165,11 @@
server {
server {
listen 80;
listen 80;
server_name demo.jumpserver.org; # 自行修改成你的域名
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 / {
location / {
proxy_pass http://jumpserver; # jumpserver
proxy_pass http://jumpserver; # jumpserver
# proxy_next_upstream http_500 http_502 http_503 http_504 http_404;
}
}
location /luna/ {
location /luna/ {
...
@@ -172,6 +183,7 @@
...
@@ -172,6 +183,7 @@
proxy_http_version 1.1;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Connection "upgrade";
# proxy_next_upstream http_500 http_502 http_503 http_504 http_404;
}
}
location /guacamole/ {
location /guacamole/ {
...
@@ -183,24 +195,7 @@
...
@@ -183,24 +195,7 @@
proxy_set_header Connection $http_connection;
proxy_set_header Connection $http_connection;
access_log off;
access_log off;
client_max_body_size 100m; # Windows 文件上传大小限制
client_max_body_size 100m; # Windows 文件上传大小限制
}
# proxy_next_upstream http_500 http_502 http_503 http_504 http_404;
}
::
$ vim /etc/nginx/conf.d/coco.stream
stream {
upstream cocossh {
server 192.168.100.12:2222;
# server ip:port max_fails=1 fail_timeout=120s;
# 这里是 coco ssh 的后端ip ,max_fails=1 fail_timeout=120s 是 HA 参数
}
server {
listen 2222;
proxy_pass cocossh;
proxy_connect_timeout 10s;
proxy_timeout 24h; #代理超时
}
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment