NGINX:严格模式下不允许使用非CSS MIME类型

时间:2017-10-11 08:26:28

标签: wordpress nginx openssl nginx-location centos6.5

我使用Wordpress + NGINX / SSL。安装后我注意到并非所有插件都正常工作,我收到此错误:

  • 没有在' mywebsite.com'解析样式表。因为在严格模式下不允许使用非CSS MIME类型。

我是Centos 6.9,php 7.2。我的主要etc / nginx / nginx.conf看起来像这样:

user kleeia nginx;
worker_processes 3;

error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;

events {
        worker_connections  1024;
        use epoll;
        multi_accept on;
}

http {
        include /etc/nginx/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  /var/log/nginx/access.log  main;

        #keep alive
        keepalive_timeout 65;
        keepalive_requests 100000;
        sendfile on;
        tcp_nopush on;
        tcp_nodelay on;

        #buffer size
        client_body_buffer_size      128k;
        client_max_body_size         64m;
        client_header_buffer_size    1k;
        large_client_header_buffers  4 4k;
        output_buffers               1 32k;
        postpone_output              1460;

        include /etc/nginx/conf.d/*.conf;
}

当然我还有我的域和子域的本地配置。我在etc / nginx / conf.d / testdev.conf中的testedev.conf是这样的:

server {
listen 80;
listen 443 ssl;
server_name testdev.com www.testdev.com;
root /home/testdev/testdev.com;
index index.php index.html index.htm;

gzip on;
gzip_min_length 1100;
gzip_buffers 4 32k;
gzip_types text/css text/x-component application/x-javascript application/javascript text/javascript text/x-js text/richtext $
gzip_vary on;

#ssl on;
ssl_certificate mycert.cert;
ssl_certificate_key mykey.key;
ssl_session_cache shared:SSL:20m;
ssl_session_timeout 10m;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;
ssl_ciphers 'ECDH+AESGCM:ECDH+AES256:ECDH+AES128:DH+3DES:!ADH:!AECDH:!MD5';

location / {
    root /home/testdev/testdev.com;
    try_files $uri $uri/ /index.php?$args;
    index index.php;
}

#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   /home/testdev/testdev.com;
}

# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
location ~ \.php$ { # this line
    root /home/testdev/testdev.com;
    try_files  $uri  $uri/  /index.php?$args;
    index  index.html index.htm index.php;

    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;

    fastcgi_pass   127.0.0.1:9000;
    fastcgi_index  index.php;
    fastcgi_split_path_info ^(.+\.php)(/.+)$;
    fastcgi_intercept_errors on;
    include /usr/local/src/publicnginx/nginx-1.9.14/conf/fastcgi_params;
}

# deny access to .htaccess files, if Apache's document root
location ~ /\.ht {
    deny  all;
}

}

ssl是Let的加密。我跟着很多文章都没有成功。我的mime类型似乎很好,包括/etc/nginx/mime.types,如下所示:我只粘贴第一部分:

 types {
    text/html                             html htm shtml;
    text/css                              css;
    text/xml                              xml;
    image/gif                             gif;
    image/jpeg                            jpeg jpg;
    application/javascript                js;
    application/atom+xml                  atom;
    application/rss+xml                   rss;
 ...
 }

我真的不知道发生了什么。我的错误日志

2017/10/11 11:05:31 [error] 12824#12824: *1619 FastCGI sent in stderr: "Unable to open primary script: /home/testdev/testdev.com/upgrade.php (No such file or directory)" while reading response header from upstream, client: 185.129.148.167, server: testev.com, request: "POST /upgrade.php HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "testev.com"

FastCGI权限?有什么想法吗?

0 个答案:

没有答案
相关问题