加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
nginx_ops.conf 2.53 KB
一键复制 编辑 原始数据 按行查看 历史
ss1917 提交于 2019-08-15 09:47 . 推送docker部署方案
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;
# }
# }
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化