报李皆知待影几懂 2022-05-15 16:22 采纳率: 80%
浏览 50
已结题

http换成https时出现的问题

问题遇到的现象和发生背景

uwsgi+nginx+vue
原http协议换成https协议出现问题

还有跨域问题(咋配置)

img

img

uwsgi.ini

[uwsgi]
uid=mlh
socket=192.168.134.128:8000
chdir=/home/mlh/run_sth/water_quality_gradution
module=wsgi.py
home=/home/mlh/run_sth/water_quality_gradution/venv
wsgi-file=water_quality/wsgi.py
process=3
thread=3
# daemonize=uwsgi.log
pidfile=uwsgiPid.log
master=True
buffer-size=65536
disable-logging=false
enable-threads=true
thunder-lock=true
protocol=http

nginx.conf

    server {
        listen       443 default ssl;
        ssl On;
        ssl_certificate 7775973_www.mlhtest.xyz.pem;
        ssl_certificate_key 7775973_www.mlhtest.xyz.key;
         server_name www.mlhtest.xyz;
         location /dist/ {
        root /home/mlh/run_sth/water-quality-web;         
         }
    location / {
     proxy_pass         http://apiserver;
            proxy_set_header   Host $host;
        }    
    }
    server {
          listen 80;
          server_name  www.mlhtest.xyz;
          location / {
              rewrite ^(.*) https://$server_name$1 redirect;
          }
      }
问题相关代码,请勿粘贴截图

跨域,到底该怎么配置,crazy!

运行结果及报错内容
我想要达到的结果

原http替换为https且正常运行

  • 写回答

5条回答 默认 最新

      报告相同问题?

      相关推荐 更多相似问题

      问题事件

      • 已结题 5月16日
      • 修改了问题 5月16日
      • 修改了问题 5月16日
      • 创建了问题 5月15日

      悬赏问题

      • ¥15 这幅db-RDA图是怎么画的?
      • ¥15 类文件具有错误的版本 61.0, 应为 52.0
      • ¥15 main函数里scanf_s("%c",&t)字符没办f法输入,断点调试时&t显示烫,求看看问题在哪?
      • ¥15 初学者学习xbeach 用matlab,缺失XBeach MATLAB Toolbox
      • ¥15 QEMU virt开发板无法访问CLINT空间
      • ¥20 如何将tiff格式数据作为因变量,输入已建立的机器学习模型中,得到结果同样为空间tiff格式的数据
      • ¥20 编写一个脚本监听sql的运行状态并联动另一台服务器上的服务重启
      • ¥215 一年前的硬盘数据恢复
      • ¥15 htmclxx 求提供给64位windows预编译库
      • ¥15 如何用线性表实现通讯录管理功能,根据条件输出对应分类的信息