forked from opendevops-cn/codo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
nginx_ops.conf
70 lines (61 loc) · 2.53 KB
/
nginx_ops.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
server {
listen 80;
server_name demo-init.opendevops.cn;
access_log /var/log/nginx/codo-access.log;
error_log /var/log/nginx/codo-error.log;
location / {
root /var/www/codo;
index index.html index.htm;
try_files $uri $uri/ /index.html;
}
location /api {
### ws 支持
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
add_header 'Access-Control-Allow-Origin' '*';
proxy_pass http://gw.opendevops.cn:8888;
}
location ~ /(.svn|.git|admin|manage|.sh|.bash)$ {
return 403;
}
}
### 下面是使用https,要注意放置证书
# server {
# listen 80;
# server_name demo-init.opendevops.cn;
# rewrite ^(.*)$ https://$host$1 permanent;
# }
# server {
# listen 443;
# server_name demo-init.opendevops.cn;
# access_log /var/log/nginx/codo-access.log;
# error_log /var/log/nginx/codo-error.log;
# ssl on;
# index index.html index.htm;
# ssl_certificate opendevops.crt;
# ssl_certificate_key opendevops.key;
# ssl_session_timeout 5m;
# ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-SHA:AES128-GCM-SHA256:AES128-SHA256:AES128-SHA:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:AES256-GCM-SHA384:AES256-SHA256:AES256-SHA:ECDHE-RSA-AES128-SHA256:!aNULL:!eNULL:!EXPORT:!DES:!3DES:!MD5:!DSS:!PKS;
# ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
# ssl_prefer_server_ciphers on;
# location / {
# root /var/www/codo;
# index index.html index.htm;
# try_files $uri $uri/ /index.html;
# }
# location /api {
# proxy_redirect off;
# proxy_read_timeout 600;
# proxy_http_version 1.1;
# proxy_set_header Upgrade $http_upgrade;
# proxy_set_header Connection "upgrade";
# proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
# add_header 'Access-Control-Allow-Origin' '*';
# proxy_pass http://gw.opendevops.cn:8888;
# }
# location ~ /(.svn|.git|admin|manage|.sh|.bash)$ {
# return 403;
# }
# }