WINNMP和GLPI配置

时间:2019-11-12 00:50:05

标签: nginx nginx-config

我在安装页面上得到的是纯文本。有人可以帮我弄清楚我做错了什么吗?

似乎install.php调用了siteroot/lib/中的js文件,但实际上是从地址install/lib/中调用的。

这是我的nginx.conf:

worker_processes auto;

events
{   
    worker_connections 798;
}

http 
{
    server_tokens   off;
    sendfile        on;
    tcp_nopush      on;
    tcp_nodelay     on;
    ssi             off;
    server_names_hash_bucket_size  64;

    ## Timeouts ##
    ##############

    client_body_timeout 5;
    client_header_timeout   5;
    keepalive_timeout   25 25;
    send_timeout        15s;
    resolver_timeout    3s;

    fastcgi_connect_timeout 5s;
    fastcgi_read_timeout    40s;
    fastcgi_send_timeout    15s;

    ## Buffers ##
    #############

    fastcgi_buffers         8 32k;
    fastcgi_buffer_size     32k;
    #fastcgi_busy_buffers_size  256k;
    #fastcgi_temp_file_write_size   256k;

    open_file_cache         off;

    # php max upload limit cannot be larger than this       
    client_max_body_size        33m;    

    ####client_body_buffer_size 1K;
    client_header_buffer_size   1k;
    large_client_header_buffers 2 1k;   
    types_hash_max_size     2048;

    include nginx.mimetypes.conf;
    default_type text/html;

    ## Logging ##
    #############

    access_log  "c:/winnmp/log/nginx_access.log";
    error_log   "c:/winnmp/log/nginx_error.log" warn;   #debug or warn
    log_not_found   on; #enables or disables messages in error_log about files not found on disk. 
    rewrite_log off;

    fastcgi_intercept_errors off;   # Do Not Change (off) !

    gzip  off;

    index  index.php index.htm index.html;

    server
    {
        # NEVER ALLOW PUBLIC ACCESS TO THIS SERVER !!!
        # Instead, create projects using WinNMP Manager, and allow public access only to those projects!
        # How to allow access from LAN and Internet to your local project:
        # http://WinNMP.wtriple.com/howtos.php#How-to-allow-access-from-LAN-and-Internet-to-your-local-project

        listen      127.0.0.1:80    default_server;     # Do Not Change ! Security Risk !
        #listen     [::1]:80    ipv6only=on;        # Do Not Change ! Security Risk !
        server_name localhost;              # Do Not Change ! Security Risk !

        # This directive is modified automatically by WinNMP.exe for portability.
        root        "c:/winnmp/www";
        autoindex on;

        allow       127.0.0.1;  # Do Not Change ! Security Risk !
        allow       ::1;        # Do Not Change ! Security Risk !
        deny        all;        # Do Not Change ! Security Risk !

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

        location = /favicon.ico
        {
                log_not_found off; 
        }

        location = /robots.txt
        {
                log_not_found off; 
        }

        ## Tools are now served from include/tools/
        location ~ ^/tools/.*\.php$
        {                   
            root "c:/winnmp/include";
            try_files $uri =404; 
            include     nginx.fastcgi.conf;
            fastcgi_pass    php_farm;
            allow       127.0.0.1;      # Do Not Change ! Security Risk !
            allow       ::1;            # Do Not Change ! Security Risk !
            deny        all;            # Do Not Change ! Security Risk !
        }

        location ~ ^/tools/
        {
            root "c:/winnmp/include";
            allow       127.0.0.1;      # Do Not Change ! Security Risk !
            allow       ::1;            # Do Not Change ! Security Risk !
            deny        all;            # Do Not Change ! Security Risk !
        }

        ## How to add phpMyAdmin 
        ## Copy phpMyAdmin files to c:/winnmp/include/phpMyAdmin then uncomment:

        #location ~ ^/phpMyAdmin/.*\.php$
        #{
        #   root "c:/winnmp/include";
        #   try_files $uri =404; 
        #   include         nginx.fastcgi.conf;
        #   fastcgi_pass    php_farm;
        #   allow           127.0.0.1;  
        #   allow           ::1;
        #   deny            all;
        #}       
        #location ~ ^/phpMyAdmin/
        #{
        #   root "c:/winnmp/include";
        #}

        ## Notice that the root directive lacks /phpMyAdmin because Nginx adds the URL path /phpMyAdmin to the root path, so the resulting directory is c:/winnmp/include/phpMyAdmin

        ## PHP for localhost ##
        #######################

        location ~ \.php$
        {
            try_files $uri =404; 
            include     nginx.fastcgi.conf;
            include     nginx.redis.conf;
            fastcgi_pass    php_farm;
            allow       127.0.0.1;      # Do Not Change ! Security Risk !
            allow       ::1;            # Do Not Change ! Security Risk !
            deny        all;            # Do Not Change ! Security Risk !
        }

        # How to allow access from LAN and Internet to your local project:
        # http://WinNMP.wtriple.com/howtos.php#How-to-allow-access-from-LAN-and-Internet-to-your-local-project
    }

    include domains.d/*.conf;
    include nginx.phpfarm.conf;
}

这是我的site.conf:

server
{
    ## How to allow access from LAN and Internet to your local project:
    ## https://winnmp.wtriple.com/howtos#How-to-allow-access-from-LAN-and-Internet-to-your-local-project

    listen      127.0.0.1:80;

    ## Enable self signed SSL certificate:
    ## https://winnmp.wtriple.com/howtos#Enable-self-signed-SSL-certificate-for-your-local-project
    # listen        127.0.0.1:443 ssl http2;
    # ssl_certificate_key "c:/winnmp/conf/opensslCA/selfsigned/Nsic.test.key";
    # ssl_certificate "c:/winnmp/conf/opensslCA/selfsigned/Nsic.test.crt";

    ## How to add additional local test server names to my project:
    ## https://winnmp.wtriple.com/howtos#How-to-add-additional-local-test-server-names-to-my-project

    server_name     Nsic.test;

    ## To manually change the root directive replace the ending comment with: # locked
    ## https://winnmp.wtriple.com/howtos#How-to-change-the-root-directory-of-a-project

    root    "c:/winnmp/www/Nsic"; # automatically modified on each restart! can be manually set by replacing this comment

    ## Access Restrictions
    allow       127.0.0.1;
    deny        all;

    ## Add locations:
    ## https://winnmp.wtriple.com/howtos#How-to-add-locations

    ## Configure for various PHP Frameworks:
    ## http://winnmp.wtriple.com/nginx.php

    autoindex on;

    location ~ \.php$
    {
        try_files $uri =404;
        include     nginx.fastcgi.conf;
        include     nginx.redis.conf;
        fastcgi_pass    php_farm;
        fastcgi_hide_header X-Powered-By;
    }

    location /
    {
        try_files $uri $uri/ =404;
    }
}

这就是我得到的:

enter image description here

0 个答案:

没有答案