Saltar para o Conteúdo principal

Using Deskpro With nginx - Knowledgebase / Deskpro Legacy - Deskpro Support

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

Using Deskpro With nginx

Lista de autores

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;
        }
    }
}
Útil Inútil

70 de 134 pessoas acharam esta Página útil

Comentário (1)

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

Adicionar um comentário

Inicie sessão ou registe-se para enviar um comentário.

Precisa de recordar a palavra-passe?