Nginx使用cloudflare ssl作为非root用户运行Java Webapp

时间:2019-10-10 12:51:04

标签: nginx reverse-proxy cloudflare nginx-reverse-proxy metabase

我正在使用具有以下配置的nginx运行配置数据库:/etc/nginx/sites-available/example.com

server {

    # SSL configuration

    listen 443 ssl http2;
    listen [::]:443 ssl http2;
    ssl        on;
    ssl_certificate         /etc/ssl/certs/cert.pem;
    ssl_certificate_key     /etc/ssl/private/key.pem;
    ssl_client_certificate /etc/ssl/certs/cloudflare.crt;
    ssl_verify_client on;
    server_name example.com www.example.com;

    root /var/www/example.com/html;
    index index.html index.htm index.nginx-debian.html;

    location / {
    proxy_pass http://127.0.0.1:3000/;
    }   
}

与Cloudflare一起使用,同时具有FullFull(strict)的{​​{1}}和Always Use HTTPS设置,同时 ON Automatic HTTPS Rewrites 关闭

例如,如果我尝试在非根目录位置运行Rocket Loader™

proxy_pass

我得到了(在Firefox控制台中):

   location /metabase/ 
        {
        proxy_pass http://127.0.0.1:3000/;
        }

在Chrome控制台中

The resource from “https://example.com/app/dist/app-main.bundle.css?4ccd5c23fd3dcf61a206fe52be657d90” was blocked due to MIME type (“text/html”) mismatch (X-Content-Type-Options: nosniff).

The resource from “https://example.com/app/dist/styles.bundle.css?dcf6d19a625c0113333c2f87a9aaef16” was blocked due to MIME type (“text/html”) mismatch (X-Content-Type-Options: nosniff).

The resource from “https://example.com/app/dist/styles.bundle.js?3f8f0db4d958de85c2e9” was blocked due to MIME type (“text/html”) mismatch (X-Content-Type-Options: nosniff).

The resource from “https://example.com/app/dist/vendor.bundle.js?3f8f0db4d958de85c2e9” was blocked due to MIME type (“text/html”) mismatch (X-Content-Type-Options: nosniff).

该页面为空白,因为未加载样式表或JavaScript:(。

is a solution个类似的问题,但它在apache上。 Nginx上有类似的东西吗?

我不确定这是nginx问题还是Cloudflare或两者的结合。

0 个答案:

没有答案