1 Star 0 Fork 0

chuan / flask_bl

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
nginx-v1.conf 3.12 KB
一键复制 编辑 原始数据 按行查看 历史
# 基于uwsgi的nginx配置
# 用户名
user root;
# 进程数
worker_processes auto;
# 日志文件地址
error_log /var/log/nginx-ht-v1/error.log;
pid /run/nginx.pid;
events {
worker_connections 1024;
}
http {
log_format log_json '{ "@timestamp": "$time_iso8601", '
'"remote_addr": "$remote_addr", '
'"request": "$request", '
'"referer": "$http_referer", '
'"requestUrl": "$request_uri",'
'"status": $status, '
'"requestTime": $request_time,'
'"requestLength": $request_length,'
'"reponseBytes": $bytes_sent, '
'"uA": "$http_user_agent", '
'"x_forwarded": "$http_x_forwarded_for", '
'"up_addr": "$upstream_addr",'
'"up_host": "$upstream_http_host",'
'"up_resp_time": "$upstream_response_time" '
'}';
# 此前的 配置不完全,同时 /etc/logrotate.d 里面nginx日志设置保存时间为 10天,此次改为 365天
access_log /var/log/nginx-ht-v1/access.log log_json;
#gzip 压缩
gzip on;
gzip_min_length 1k;
gzip_buffers 4 16k;
gzip_http_version 1.1;
gzip_comp_level 6;
gzip_types text/plain application/x-javascript text/css application/xml text/javascript application/x-httpd-php application/javascript application/json;
gzip_disable "MSIE [1-6]\.";
gzip_vary on;
sendfile on;
keepalive_timeout 65;
# 支持文件类型目录
include /etc/nginx/mime.types;
default_type application/octet-stream;
#上传文件的大小限制 默认1m
client_max_body_size 11m;
# https配置
server {
listen 443 ssl;
server_name hcuan.top;
ssl_certificate /etc/ssl/hcuan_top.pem;
ssl_certificate_key /etc/ssl/hcuan_top.key;
ssl_session_timeout 5m;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:HIGH:!aNULL:!MD5:!RC4:!DHE;
# 开始不同 nginx, flask项目
root /root/projects/flask_bl;
location /static {
alias /root/projects/flask_bl/static;
}
location / {
# 搭建nginx和uwsgi的桥梁
include /etc/nginx/uwsgi_params;
# uwsgi 地址
uwsgi_pass localhost:8080;
}
error_page 404 /404.html;
location = /40x.html {
root /root/projects/flask_bl/templates;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
}
# 转发至 443
server {
listen 80;
server_name localhost;
rewrite ^/(.*)$ https://hcuan.top:443/$1 permanent;
}
}
Python
1
https://gitee.com/chuancode/flask_bl.git
git@gitee.com:chuancode/flask_bl.git
chuancode
flask_bl
flask_bl
new-bt

搜索帮助