跳到主要内容

Using Deskpro With nginx - 知识库 / Deskpro Legacy - Deskpro Support

WARNING: You're browsing documentation for an older version of Deskpro. Consider upgrading to Deskpro Horizon

Using Deskpro With nginx

作者列表

Deskpro runs well under nginx with php-fpm. Here is an example server block configuration with the necessary URL rewrites in place. You will need to update the paths accordingly.

 

server {
    server_name support.example.com;
    listen 80;

    set $fastcgi_pass 127.0.0.1:19000;
    set $deskpro_www_root /path/to/deskpro/www;

    root $deskpro_www_root;

    proxy_buffer_size 128k;
    proxy_buffers 4 256k;
    proxy_busy_buffers_size 256k;

    fastcgi_buffer_size 128k;
    fastcgi_buffers 4 256k;
    fastcgi_busy_buffers_size 256k;

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

    location ~ \.php$ {
        include fastcgi_params;
        fastcgi_pass $fastcgi_pass;
        fastcgi_split_path_info ^(.+\.php)(/.*)$;
        fastcgi_param SCRIPT_FILENAME $deskpro_www_root/index.php;
    }

    location ~ /assets/[a-zA-Z0-9_\-\.]+/(pub|web)/.*?$ {
        add_header 'Access-Control-Allow-Origin' '*';
        add_header 'Access-Control-Allow-Credentials' 'true';
        add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
        add_header 'Access-Control-Allow-Headers' 'DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type';

        if ($request_method = 'OPTIONS') {
            add_header 'Access-Control-Max-Age' 1728000;
            add_header 'Content-Type' 'text/plain charset=UTF-8';
            add_header 'Content-Length' 0;
            return 204;
        }
    }
}
有帮助 没有帮助

134 人中 70 人认为这个页面有帮助

Comments (1)

Jeff Jenkins
Any chance would could recommend how to set deskPro up on a subdirectory with Nginx? http://mysite.com/deskpro/

添加一条评论

请登录或注册以提交评论。

是否需要密码提醒?