StudyOverseas 发表于 2019-3-30 14:31:42

用Nginx反代之后如何改response?

本帖最后由 StudyOverseas 于 2019-3-30 14:45 编辑

问题和这位一样:https://github.com/getsentry/onpremise/issues/57

Nginx反代部分配置如下:
location /
{

    proxy_pass http://123.123.123.123:1234;
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header REMOTE-HOST $remote_addr;
    add_header X-Cache $upstream_cache_status;
    proxy_hide_header X-Frame-Options;
    sub_filter "http://" "https://";
    sub_filter_once off;
    expires 12h;
}

反代之后用https打开网页正常,浏览内容也都是正常的,但是提交表单就chrome报错(mixed content)
然后我设置了filter,但是response依旧有一部分是http://的,不知道怎么改为https://


调试信息:Mixed Content: The page at '' was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint ''. This content should also be served over HTTPS


看了一下http://的都是本域名下的js文件...

xayle 发表于 2019-3-30 14:32:45

sub_filter_once off;

StudyOverseas 发表于 2019-3-30 14:42:04


xayle 发表于 2019-3-30 14:32

sub_filter_once off;
我加上了的,依旧没有用
页: [1]
查看完整版本: 用Nginx反代之后如何改response?