Skip to content

Commit

Permalink
Merge pull request #67 from deskpro/x-accel-redirect
Browse files Browse the repository at this point in the history
Add support for use of the nginx X-Accell-Redirect headers
  • Loading branch information
MattGrundy authored Oct 9, 2024
2 parents 5638c2d + f3b83ba commit e91fa6d
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
1 change: 1 addition & 0 deletions etc/nginx/conf.d/deskpro_fastcgi_noxaccel.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
fastcgi_ignore_headers "X-Accel-Redirect" "X-Accel-Expires" "X-Accel-Limit-Rate" "X-Accel-Buffering" "X-Accel-Charset";
22 changes: 22 additions & 0 deletions etc/nginx/conf.d/deskpro_server_params.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -25,24 +25,43 @@ location / {
try_files $uri $uri/ /index.php?$query_string;
}

{{if (getenv "DESKPRO_BLOBS_PATH") }}
location ^~ /sys/services/blobs/private {
internal;
alias {{ regexp.Replace "(/+|/*$)" "/" (getenv "DESKPRO_BLOBS_PATH") }};
}
{{end}}

location ^~ /sys/services/blobs/fetch {
fastcgi_pass unix:/run/php_fpm_dp_internal.sock;
include /etc/nginx/conf.d/deskpro_fastcgi_params;
{{if not (getenv "DESKPRO_BLOBS_PATH" )}}
include /etc/nginx/conf.d/deskpro_fastcgi_noxaccel;
{{end}}
}

location ^~ /sys/services/broadcaster/ {
fastcgi_pass unix:/run/php_fpm_dp_broadcaster.sock;
include /etc/nginx/conf.d/deskpro_fastcgi_params;
include /etc/nginx/conf.d/deskpro_fastcgi_noxaccel;
}

location ~ ^/(admin\-api|agent\-api)/ {
fastcgi_pass unix:/run/php_fpm_dp_gql.sock;
include /etc/nginx/conf.d/deskpro_fastcgi_params;
include /etc/nginx/conf.d/deskpro_fastcgi_noxaccel;
}

location ~ ^/(ticket\-channels|sys/services)/ {
fastcgi_pass unix:/run/php_fpm_dp_internal.sock;
include /etc/nginx/conf.d/deskpro_fastcgi_params;
include /etc/nginx/conf.d/deskpro_fastcgi_noxaccel;
}

location ^~ /api/ {
fastcgi_pass $dpv5_api_backend;
include /etc/nginx/conf.d/deskpro_fastcgi_params;
include /etc/nginx/conf.d/deskpro_fastcgi_noxaccel;
}

location ^~ /sys/services/messenger-api/ {
Expand Down Expand Up @@ -105,18 +124,21 @@ location ~ ^/deskpro-messenger/assets/ {
location ^~ /firebase-messaging-sw.js {
fastcgi_pass unix:/run/php_fpm_dp_default.sock;
include /etc/nginx/conf.d/deskpro_fastcgi_params;
include /etc/nginx/conf.d/deskpro_fastcgi_noxaccel;
}

location ~ ^/deskpro-messenger/ {
add_header X-XSS-Protection "1; mode=block";
add_header X-Content-Type-Options "nosniff";
fastcgi_pass unix:/run/php_fpm_dp_default.sock;
include /etc/nginx/conf.d/deskpro_fastcgi_params;
include /etc/nginx/conf.d/deskpro_fastcgi_noxaccel;
}

location ~ \.php$ {
fastcgi_pass unix:/run/php_fpm_dp_default.sock;
include /etc/nginx/conf.d/deskpro_fastcgi_params;
include /etc/nginx/conf.d/deskpro_fastcgi_noxaccel;
}

location ~ /assets/[a-zA-Z0-9_\-\.]+/(pub|web)/.*?$ {
Expand Down

0 comments on commit e91fa6d

Please sign in to comment.