Прескочи към главното съдържание

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;
        }
    }
}
Полезно Не беше полезно

70 от 134 души смятат тази страница за полезна

Коментар (1)

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

Добави коментар

Моля, логнете се или се регистрирайте, за да оставите коментар.

Нуждаете се от подсещане за парола?