【问题标题】:NGINX on Windows - No input file specifiedWindows 上的 NGINX - 未指定输入文件
【发布时间】:2021-05-17 05:34:50
【问题描述】:

我已经在我的 Windows vServer 上安装了 NGINX Web 服务器。只是我无法进一步了解,我不断收到此消息“未指定输入文件。”。

我用谷歌搜索了很多,但我无法进一步了解。我寻求帮助。我的 NGINX 服务器在下面

C:/nginx/html

我已经写了一个 PHP.bat 以便 PHP 工作。

域名是:habbo.manag.media

我把什么弄错了?

    include       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  logs/access.log  main;

    sendfile        on;
    tcp_nopush     on;

    #keepalive_timeout  0;
    keepalive_timeout  65;

    gzip  on;

    server {
        listen       80;
        server_name  habbo.manag.media;
        #charset koi8-r;


        #error_page  404              /404.html;

        # redirect server error pages to the static page /50x.html
        #
        error_page   500 502 503 504  /50x.html;


        # proxy the PHP scripts to Apache listening on 127.0.0.1:80
        #
        #location ~ \.php$ {
        #    proxy_pass   http://127.0.0.1;
        #}

        # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
        #

        location ~* \.(eot|otf|ttf|woff|woff2)$ {
            add_header Access-Control-Allow-Origin *;
        }

         location / {
             try_files $uri $uri/ /index.php?$query_string;
        }

        index index.php index.html index.htm;
        include fastcgi.conf;
        # root   c:/Users/Kelly\ Marchewa/workspace/Code/MidAmCorp/out;

        root html;

        location ~ \.php$ {
            fastcgi_split_path_info ^(.+\.php)(/.+)$;
                        fastcgi_pass   127.0.0.1:9000;
                    fastcgi_index index.php;
                    include fastcgi_params;
                    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                    fastcgi_param PATH_INFO $fastcgi_path_info;
        }

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

【问题讨论】:

    标签: php nginx webserver


    【解决方案1】:

    您尚未定义您的根目录和服务器配置。

    root   <your absolute path to root folder goes here>;
    index  index.html index.htm index.php;
    

    这定义了您的根文件夹的位置以及您网站上的入口点。希望这能回答您的问题。

    【讨论】:

    • 我不知道我的路径会是什么。我已经尝试过html。然后也是 C:/nginx/html 只是没有工作
    • 路径应该是这样的:c:/Users/YourUser/PhpstormProjects
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2018-05-26
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-02-12
    • 2013-12-26
    • 2016-06-09
    相关资源
    最近更新 更多