91超碰碰碰碰久久久久久综合_超碰av人澡人澡人澡人澡人掠_国产黄大片在线观看画质优化_txt小说免费全本

溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》

nginx配置https自簽名(openssl生成)證書

發布時間:2020-05-27 20:42:33 來源:網絡 閱讀:1512 作者:ouyida3 欄目:安全技術

openssl生成證書

  1. openssl genrsa -out server.key 2048
  2. openssl req -new -key server.key -out server.csr
  3. openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt

[nginx@machine certificate]$  openssl genrsa -out server.key 2048
Generating RSA private key, 2048 bit long modulus
..+++
......................................................................+++
e is 65537 (0x10001)
[nginx@machine certificate]$ ll
total 4
-rw-r----- 1 nginx nginx 1679 Jul 11 16:35 server.key
[nginx@machine certificate]$ 
[nginx@machine certificate]$ openssl req -new -key server.key -out server.csr
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,

If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [XX]:cn
State or Province Name (full name) []:gd
Locality Name (eg, city) [Default City]:gz
Organization Name (eg, company) [Default Company Ltd]:ai
Organizational Unit Name (eg, section) []:ai
Common Name (eg, your name or your server's hostname) []:
Email Address []:

Please enter the following 'extra' attributes
to be sent with your certificate request
A challenge password []:
An optional company name []:
[nginx@machine certificate]$ 
[nginx@machine certificate]$ openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt
Signature ok
subject=/C=cn/ST=gd/L=gz/O=ai/OU=ai
Getting Private key
[nginx@machine certificate]$ ll
total 12
-rw-r----- 1 nginx nginx 1099 Jul 11 16:36 server.crt
-rw-r----- 1 nginx nginx  952 Jul 11 16:35 server.csr
-rw-r----- 1 nginx nginx 1679 Jul 11 16:35 server.key
[nginx@machine certificate]$ 

nginx配置

[nginx@machine ~]$ cd /etc/nginx/
[nginx@machine nginx]$ more nginx.conf

user nginx;
worker_processes 1;

error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;

events {
worker_connections 1024;
}

http {
include /etc/nginx/mime.types;
default_type application/octet-stream;

log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                  '$status $body_bytes_sent "$http_referer" '
                  '"$http_user_agent" "$http_x_forwarded_for"';

access_log  /var/log/nginx/access.log  main;

sendfile        on;
#tcp_nopush     on;

keepalive_timeout  65;

#gzip  on;

upstream zuul_nginx {
    server 10.13.22.104:8080;
    server 10.13.22.105:8080;
    server 10.13.22.106:8080;
    server 10.13.22.107:8080;
}

server {
    listen 18010 ssl;
    #listen 443 ssl;
    #server_name 10.13.22.124;
    ssl on;
    ssl_certificate /app/nginx/certificate/server.crt;
    ssl_certificate_key /app/nginx/certificate/server.key;
    ssl_session_timeout  5m;
    ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
    #ssl_ciphers  HIGH:!aNULL:!MD5;
    ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:HIGH:!aNULL:!MD5:!RC4:!DHE;
    ssl_prefer_server_ciphers   on;
    location /ouyidaorder {
        proxy_pass http://zuul_nginx;
    }
}

server {
    listen 8080 ssl;
    ssl on;
    ssl_certificate /app/nginx/certificate/server.crt;
    ssl_certificate_key /app/nginx/certificate/server.key;
    ssl_session_timeout  5m;
    ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
    ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:HIGH:!aNULL:!MD5:!RC4:!DHE;
    ssl_prefer_server_ciphers   on;
    location /ouyidaorder {
        proxy_pass http://zuul_nginx;
    }
}

include /etc/nginx/conf.d/*.conf;

}

用root重啟nginx。

測試

(1)瀏覽器訪問:https://10.13.22.124:8080/ouyidaorder/api/Subscribe
(2)curl https://10.13.22.124:18010/ouyidaorder/api/Subscribe

向AI問一下細節

免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。

AI

湾仔区| 山阳县| 吉林省| 高邑县| 蕲春县| 岢岚县| 屯留县| 武陟县| 浪卡子县| 武邑县| 六安市| 鹤峰县| 建始县| 萍乡市| 德化县| 阜宁县| 大石桥市| 宣武区| 安康市| 宁南县| 邓州市| 当涂县| 奇台县| 都匀市| 武宁县| 江川县| 沂水县| 东乡| 沂源县| 宣汉县| 板桥市| 保德县| 乌拉特前旗| 云安县| 镇安县| 柯坪县| 法库县| 两当县| 临沧市| 玛曲县| 封开县|