指令配置Ubuntu 18.04 / Nginx 1.8.2中的错误404

问题描述

user  Nginx Nginx;
worker_processes  1;
worker_rlimit_nofile 10240;

error_log  logs/error.log  info;
pid        logs/Nginx.pid;

events {
    worker_connections  1024;
}


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

    reset_timedout_connection on;

    server_tokens off;
    autoindex off;

    keepalive_timeout  0;

    perl_modules  perl;
    perl_require  xale.pm;  

    # HTTPS server
    server {

        listen       *:80 http2;

        server_name  sub.mydomain.com;

        proxy_set_header    Upgrade             $http_upgrade;
        proxy_set_header    Connection          "upgrade";
        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    X-Forwarded-Proto   $scheme;
        proxy_set_header    X-Client-DN         $ssl_client_s_dn;
        proxy_set_header    X-SSL-Subject       $ssl_client_s_dn;
        proxy_set_header    X-SSL-Issuer        $ssl_client_i_dn;
        proxy_set_header    X-Forwarded-Host    $host;
        proxy_set_header    X-Forwarded-Port    $server_port;

        # To debug info
        add_header X-debug-https $remote_addr always;
        add_header Strict-Transport-Security "max-age=31536000";
        add_header X-Content-Type-Options nosniff;

        # Root domain
        location / {
            root /var/www/html;
            index  index.html index.htm index.PHP;
            try_files $uri $uri/ =404;
        }

        # Static images
        location ~* \.(3gp|gif|jpg|jpeg|png|ico|wmv|avi|asf|asx|mpg|mpeg|mp4|pls|mp3|mid|wav|swf|flv|exe|zip|tar|rar|gz|tgz|bz2|uha|7z|doc|docx|xls|xlsx|pdf|iso|eot|svg|ttf|woff)$ {
            gzip_static off;
            add_header Pragma public;
            add_header Cache-Control "public,must-revalidate,proxy-revalidate";
            access_log off;
            expires 30d;
            break;
        }

        location /in/ {
            perl xale::in_handler;
        }

        
        # ### Run CGI scripts
        location /cgi-bin/ {
            root /var/www;
            gzip off;
            fastcgi_pass unix:/var/run/fcgiwrap.socket;
            include fastcgi_params;
            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        }

              

        # 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   html;
        }
    }

}

我运行 http://sub.mydomain.com/in/xxxxxxx.html ,但不运行我的脚本 perl xale :: in_handler;

根服务器中不存在文件 / in / / cgi-bin /在服务器中的真实文件夹/ cgi-bin /下正常工作

当我将 perl xale :: in_handler; 移至指令 location / {...} =>脚本运行正常

时,

我使用ubuntu 18.04和Nginx 1.8.2 那我的配置有什么错误???

谢谢

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)