问题遇到的现象和发生背景
uwsgi+nginx+vue
原http协议换成https协议出现问题
还有跨域问题(咋配置)
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且正常运行