柳暗花明笔记

    nginx安装osticket系统的配置

    所属分类:[ php&web ] 猫哲学家 发表于:2016-09-08 14:50 浏览:262

    要设置path_info的,哈哈!

    set $path_info "";

    # Deny access to all files in the include directory
    location ~ ^/include {
    deny all;
    return 403;
    }

    # Deny access to apache .ht* files (nginx doesn't use these)
    location ~ /\.ht {
    deny all;
    }


    # Requests to /api/* need their PATH_INFO set, this does that
    if ($request_uri ~ "^/api(/[^\?]+)") {
    set $path_info $1;
    }

    # /api/*.* should be handled by /api/http.php if the requested file does not exist
    location ~ ^/api/(tickets|tasks)(.*)$ {
    try_files $uri $uri/ /api/http.php;
    }

    # /scp/ajax.php needs PATH_INFO too, possibly more files need it hence the .*\.php
    if ($request_uri ~ "^/scp/.*\.php(/[^\?]+)") {
    set $path_info $1;
    }

    # Make sure requests to /scp/ajax.php/some/path get handled by ajax.php
    location ~ ^/scp/ajax.php/(.*)$ {
    try_files $uri $uri/ /scp/ajax.php;
    }

    # Set index.php as our directoryindex
    location / {
    index index.php;
    }

    # Send php files off to the PHP-FPM listing on localhost:9000
    location ~ \.php$ {
    try_files $uri =404;
    fastcgi_pass unix:/tmp/php-cgi.sock;
    fastcgi_index index.php;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    fastcgi_param PATH_INFO $path_info;
    include fastcgi_params;
    }

    标签: nginx  http 
    上一编文章 redis linux安装与使用测试 下一编文章 html 选择时出现下拉的实现方式 select auto comple
    最近文章
    发表评论