nginx + OTRS + Apache mod_perl

Apache is running on port 800, nginx on port 80.

OTRS is installed in /opt/otrs/.


Apache-related config

 

ServerName support.xxx.com 
 
# agent, admin and customer frontend 
ScriptAlias /otrs/ "/opt/otrs/bin/cgi-bin/" 
Alias /otrs-web/ "/opt/otrs/var/httpd/htdocs/" 

 
 Perlrequire /opt/otrs/scripts/apache2-perl-startup.pl 
 PerlModule Apache2::Reload 
 PerlInitHandler Apache2::Reload 
 PerlModule Apache2::RequestRec 
 
  
 ErrorDocument 403 /otrs/customer.pl 
# ErrorDocument 403 /otrs/index.pl 
 SetHandler perl-script 
 PerlResponseHandler ModPerl::Registry 
 Options +ExecCGI 
 PerlOptions +ParseHeaders 
 PerlOptions +SetupEnv 
 Order allow,deny 
 Allow from all 
  
 AllowOverride None 
 Options +ExecCGI -Includes 
 Order allow,deny 
 Allow from all 
 
 AllowOverride None 
 Order allow,deny 
 Allow from all 
 
 Header set Cache-Control "max-age=2592000 must-revalidate" 
  
 Header set Cache-Control "max-age=2592000 must-revalidate" 
 

nginx-related config

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

 proxy_redirect off;

 proxy_set_header Host $host;
 proxy_set_header X-Real-IP $remote_addr;
 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
 proxy_max_temp_file_size 0;

 client_max_body_size 10m;
 client_body_buffer_size 128k;

 proxy_connect_timeout 90;
 proxy_send_timeout 90;
 proxy_read_timeout 90;

 proxy_buffer_size 4k;
 proxy_buffers 4 32k;
 proxy_busy_buffers_size 64k;
 proxy_temp_file_write_size 64k;

 proxy_store_access user:rw group:rw all:r;


 root /opt/otrs/var/httpd/htdocs;

 location /otrs-web {
   alias /opt/otrs/var/httpd/htdocs;
 }

 location ~ ^/otrs/(.*\.pl)(/.*)?$ {
   proxy_pass http://127.0.0.1:800;
 }

 location = / {
    rewrite ^ http://support.xxx.com/otrs/customer.pl permanent;
 }
}