首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >nginx - PNG文件通过快速PNG?

nginx - PNG文件通过快速PNG?
EN

Server Fault用户
提问于 2018-02-21 03:33:12
回答 1查看 1.6K关注 0票数 0

当面对下面的错误时,我注意到PNG文件似乎正在通过快速the。我对nginx不太熟悉,但在我看来是不对的。

我确实尝试将一些PHP代码放入一个PNG文件中,但是它没有被执行。

代码语言:javascript
复制
[warn] 2507#0: *35744 an upstream response is buffered to a temporary file /www/wdlinux/nginx-1.8.1/fastcgi_temp/9/60/0000012609 while reading upstream, client: 888.888.888.888, server: example.com, request: "GET /images/25.png HTTP/1.1", upstream: "fastcgi://unix:/tmp/php-55-cgi.sock:", host: "example.com", referrer: "http://example.com/app.php"

这里有问题吗还是我太天真了。我原以为nginx只是发送静态文件,而不是通过任何与cgi相关的文件发送。

一些可能相关的档案:

代码语言:javascript
复制
# nginx conf conf/nginx.conf
# Created by http://www.wdlinux.cn
# Last Updated 2010.06.01
user  www www;
worker_processes  3;
error_log  logs/error.log  notice;
pid        logs/nginx.pid;
worker_rlimit_nofile 5120;
events {
    use epoll;
    worker_connections  5120;
}

http {
    include       mime.types;
    default_type  application/octet-stream;

    server_names_hash_bucket_size 128;
    client_header_buffer_size 256k;
    large_client_header_buffers 8 64k;
    client_max_body_size 100m;
    limit_conn_zone $binary_remote_addr zone=one:32k;

    sendfile        on;
    tcp_nopush     on;

    keepalive_timeout  60;
    tcp_nodelay on;

    gzip  on;
    gzip_min_length  1k;
    gzip_buffers     4 16k;
    gzip_http_version 1.0;
    gzip_comp_level 2;
    gzip_types       text/plain application/x-javascript text/css application/xml;
    gzip_vary on;

    log_format  wwwlogs  '$remote_addr - $remote_user [$time_local] $request $status $body_bytes_sent $http_referer $http_user_agent $http_x_forwarded_for';
    #include default.conf;
    include vhost/*.conf;
}

naproxy.conf

代码语言:javascript
复制
proxy_connect_timeout 30s;
proxy_send_timeout   90;
proxy_read_timeout   90;
proxy_buffer_size    32k;
proxy_buffers     4 32k;
proxy_busy_buffers_size 64k;
proxy_redirect     off;
proxy_hide_header  Vary;
proxy_set_header   Accept-Encoding '';
proxy_set_header   Host   $host;
proxy_set_header   Referer $http_referer;
proxy_set_header   Cookie $http_cookie;
proxy_set_header   X-Real-IP  $remote_addr;
proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;

Vhost文件

代码语言:javascript
复制
server {
        listen       80;
        root /mnt/web/example/public_html;
        server_name example.com example.com;
        index  index.html index.php index.htm;
        error_page  400 /errpage/400.html;
        error_page  403 /errpage/403.html;
        error_page  404 /errpage/404.html;
        error_page  503 /errpage/503.html;
        location ~ \.php(.*)$ {
                fastcgi_pass  unix:/tmp/php-55-cgi.sock;
                fastcgi_index  index.php;
                fastcgi_param  SCRIPT_FILENAME  $DOCUMENT_ROOT$fastcgi_script_name;
                fastcgi_param PATH_INFO $2;
                include fcgi.conf;
        }
        location ~ /\.ht {
                deny  all;
        }
        location / {
                 try_files $uri $uri/ /?$args;
        }
}

如果需要更多的文件,我会添加它们,非常感谢!

EN

回答 1

Server Fault用户

发布于 2018-02-21 07:35:58

如果系统中没有文件/mnt/web/example/public_html/images/25.png,nginx将向http://example.com/images/25.png处理器发送D1请求。

此行为在try_files $uri $uri/ /?$args;行中指定。

票数 0
EN
页面原文内容由Server Fault提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://serverfault.com/questions/898136

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档