调节前后端连接

Blade 未结 1 470
onlynew
onlynew 剑童 2023-03-20 16:31

一、该问题的重现步骤是什么?

  1. 后端端口地址为http://121.37.226.113:8050/blade-visual   

  2. 前端url内容为 https://121.37.226.113:8050/blade-visual

3.


二、你期待的结果是什么?实际看到的又是什么?

目前在nginx配置ssl后,前端页面访问不到

三、你正在使用的是什么产品,什么版本?在什么操作系统上?

blade-visual可视化大屏幕,在linux服务器

四、请提供详细的错误堆栈信息,这很重要。

前端页面不显示

五、若有更多详细信息,请在下面提供。

nginx配置信息



#user  nobody;

worker_processes  1;


#error_log  logs/error.log;

#error_log  logs/error.log  notice;

#error_log  logs/error.log  info;


#pid        logs/nginx.pid;



events {

    worker_connections  1024;

}



http {

    include       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  logs/access.log  main;


    sendfile        on;

    #tcp_nopush     on;


    #keepalive_timeout  0;

    keepalive_timeout  65;


    #gzip  on;


    server {

        listen       80;

        server_name  test.iotdae.com:80;

        rewrite ^(.*)$ https://$host$1;


        #charset koi8-r;


        #access_log  logs/host.access.log  main;


        location / {

            root   /usr/share/nginx;

            index  index.html index.htm;

        }

location /blade-visual{

            proxy_pass https://121.37.226.113:8050;

        }


        #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;

        }


        # proxy the PHP scripts to Apache listening on 127.0.0.1:80

        #

        #location ~ \.php$ {

        #    proxy_pass   http://127.0.0.1;

        #}


        # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000

        #

        #location ~ \.php$ {

        #    root           html;

        #    fastcgi_pass   127.0.0.1:9000;

        #    fastcgi_index  index.php;

        #    fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;

        #    include        fastcgi_params;

        #}


        # deny access to .htaccess files, if Apache's document root

        # concurs with nginx's one

        #

        #location ~ /\.ht {

        #    deny  all;

        #}

    }



    # another virtual host using mix of IP-, name-, and port-based configuration

    #

    #server {

    #    listen       8000;

    #    listen       somename:8080;

    #    server_name  somename  alias  another.alias;


    #    location / {

    #        root   html;

    #        index  index.html index.htm;

    #    }

    #}



    # HTTPS server

    server {

        listen       443 ssl;

        server_name  test.iotdae.com;


        ssl_certificate      /usr/local/nginx/nginx-1.18.0/conf/cert/test.iotdae.com.crt;

        ssl_certificate_key  /usr/local/nginx/nginx-1.18.0/conf/cert/test.iotdae.com.key;

ssl_protocols TLSv1.2 TLSv1.3;

        ssl_session_cache    shared:SSL:1m;

        ssl_session_timeout  5m;


        ssl_ciphers  HIGH:!aNULL:!MD5;

        ssl_prefer_server_ciphers  on;


        location / {

            root   /usr/share/nginx;

            index  index.html index.htm;

        }

    }

server{

        listen 80;

        server_name test.iotdae.com;

        rewrite ^/(.*)$ https://test.iotdae.com;

    }

}


1条回答
  • 为了避免数据大屏前端部署的影响,你可以直接用nginx自带的首页作为模拟网站来部署ssl。

    当nginx自带首页可以用ssl地址访问,则说明成功了,可以把大屏前端的文件覆盖再访问。

    关于ssl是如何配置的,需要来根据ssl的产品手册来进行部署,不同的ssl部署方式和配置不一样,还是要以ssl官方文档为准。这些其实和大屏前端无关了。

    只要nginx自带首页的ssl能成功,则覆盖大屏文件后就能成功。

    0 讨论(0)
提交回复