Nginx 同时支持 http 和 https SSL 为了能有权限调取摄像头

Nginx 同时支持 http 和 https

当然起项目的会后也分成俩

    "dev": "vue-cli-service serve --port=8080",
    "dev:ssl": "vue-cli-service serve --port=8081 --https",
  server {
      listen       8889 ssl;
      server_name  localhost;

      ssl_certificate      ../html/cert/server.crt;
      ssl_certificate_key  ../html/cert/server.key;

      ssl_session_timeout  1m;
      ssl_protocols  SSLv2 SSLv3 TLSv1.2;
      #ssl_ciphers  HIGH:!aNULL:!MD5;
      ssl_ciphers     ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES256:AES128-SHA:AES256-SHA:RC4-SHA:DES-CBC3-SHA:RC4-MD5;
      ssl_prefer_server_ciphers   on;

      location /process_web_xxxx {
        proxy_pass https://192.168.40.54:5002/process_web_xxxx/;
      }

      location /xxxx_web {
        proxy_pass https://192.168.40.54:8081/xxxx_web/;
      }
      #error_page  404              /404.html;

      # redirect server error pages to the static page /50x.html
      #
      error_page   500 502 503 504  /50x.html;
      location = /50x.html {
          root   html;
      }
  }

    server {
      listen       8888;
      server_name  localhost;

      location /process_web_xxxx {
        proxy_pass http://192.168.40.54:5001/process_web_xxxx/;
      }

      location /xxxx_web {
        proxy_pass http://192.168.40.54:8080/xxxx_web/;
      }
      #error_page  404              /404.html;

      # redirect server error pages to the static page /50x.html
      #
      error_page   500 502 503 504  /50x.html;
      location = /50x.html {
          root   html;
      }
  }
原文地址:https://www.cnblogs.com/pengchenggang/p/12978573.html