-
solo 用 docker 安装,如何配置 https(nginx 或者其它)
2020-06-11 16:31这个 Solo 的 listen_port 是随便填一下(nginx 也不用配置)还是说配置好会在 nginx 中用到(upstream 中的端口监听)
upstream backend { server localhost:8080; # Solo 监听端口 } server { listen 80; server_name 88250.b3log.org; # 博客域名 access_log off; location / { proxy_pass http://backend$request_uri; proxy_set_header Host $http_host; proxy_set_header X-Real-IP $remote_addr; client_max_body_size 10m; } }
-
solo 用 docker 安装,如何配置 https(nginx 或者其它)
2020-06-11 16:00请大佬指教一下 nginx 配置吧(自己感觉是 nginx 没配置对的原因---nginx 使用 dnf 安装的,没用 docker--基于 centos8)
docker run --detach --name solo --network=host \ --env RUNTIME_DB="MYSQL" \ --env JDBC_USERNAME="***" \ --env JDBC_PASSWORD="***" \ --env JDBC_DRIVER="com.mysql.cj.jdbc.Driver" \ --env JDBC_URL="jdbc:mysql://192.168.***:3306/****?useUnicode=true&characterEncoding=UTF-8&useSSL=true&serverTimezone=PRC&&allowPublicKeyRetrieval=true" \ b3log/solo --listen_port=1102 --server_scheme=https --server_host=www.***.com --server_port=1101
上边是我 docker 安装;
下边是我 nginx 配置(求看下 nginx 是不是没配置对,我 docker 安装的 server_scheme 用 http 已经完全可以用了):
events { use epoll; worker_connections 51200; multi_accept on; } http{ gzip on; gzip_min_length 1k; gzip_buffers 4 16k; gzip_http_version 1.1; gzip_comp_level 2; gzip_types text/plain application/javascript application/x-javascript text/javascript text/css application/xml application/xml+rss; gzip_vary on; gzip_proxied expired no-cache no-store private auth; gzip_disable "MSIE [1-6]\."; server_tokens off; access_log off; server { server_name www.****.com:1102; listen 1101 ssl http2; ssl_certificate /etc/nginx/ssl_certs/1_www.*****.com_bundle.crt; ssl_certificate_key /etc/nginx/ssl_certs/2_www.****.com.key; ssl_session_timeout 5m; ssl_protocols TLSv1.1 TLSv1.2; ssl_prefer_server_ciphers on; ssl_ciphers "EECDH+CHACHA20:EECDH+CHACHA20-draft:EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256:EECDH+3DES:RSA+3DES:!MD5"; ssl_session_cache builtin:1000 shared:SSL:10m; location / { proxy_set_header X-Real-IP $remote_addr; proxy_pass https://www.****.com:1101; } access_log /etc/nginx/conf.d/www.****.com.log; } }