Jump to content


Click here to lend your support to: Traq and make a donation at pledgie.com !
Photo

3.x on Nginx


  • Please log in to reply
7 replies to this topic

#1 Harold

Harold

    Newbie

  • Members
  • Pip
  • 2 posts

Posted 09 May 2013 - 01:01 PM

I've managed to install Traq 3.2 on Nginx using "try_files $uri/ /index.php;" in the virtual host, but I keep getting errors throughout the application.

It seems that none of the popups work: "View Error Unable to load view 'TicketTasks/manage.js'"

Any pointers in fixing this?

#2 Jack

Jack

    Project Founder

  • Administrators
  • 673 posts
  • LocationAustralia

Posted 09 May 2013 - 02:02 PM

You could try the rewrite below, but it's setup to work with Traq on it's own "vhost" / site.

location / {
  try_files $uri $uri/ @rewrite;
}
location @rewrite {
  rewrite ^(.*)$ /index.php;
}


#3 Harold

Harold

    Newbie

  • Members
  • Pip
  • 2 posts

Posted 11 May 2013 - 10:24 PM

Thanks Jack, that fixed it!

#4 echi

echi

    Newbie

  • Members
  • Pip
  • 2 posts

Posted 22 November 2013 - 09:16 PM

Hello,

 

i am using nginx and Traq 3.x is in domain.tld/projects/traq

 

I´m trying since many(!!!) hours to get that thing work - without success.... can you help me please???

 

Currently I have:

location ^~ /projects/traq {
  try_files $uri $uri/ @rewrite;
}
location @rewrite {
  rewrite ^/projects/trac/(.*)$ /projects/trac/index.php;
}

in / there is a CMS and it runs (just to show that my PHP setup is working)

 

 

Greetings

echi



#5 Jack

Jack

    Project Founder

  • Administrators
  • 673 posts
  • LocationAustralia

Posted 27 November 2013 - 04:20 PM

echi, you said Traq is installed to "/projects/traq" but in the "@rewrite" block you have "/projects/trac".

 

If that's not the issue I would have to install Traq into a sub-directory on nginx and play around with it myself.



#6 echi

echi

    Newbie

  • Members
  • Pip
  • 2 posts

Posted 14 October 2014 - 05:53 PM

Hello!

 

traq in a subdir served with nginx can be done with

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



#7 pauloklaus

pauloklaus

    Newbie

  • Members
  • Pip
  • 1 posts

Posted 13 July 2016 - 01:24 PM

Hi,

I'm trying to install Traq at the root of a subdomain. Already include adjustments in nginx. I can access support.mydomain.com/install. But after I click "Accept" button, the browser is slow to respond and then the error appears: "incorrect redirection".

How should I proceed?

 

Nginx config:

 

server {
  listen 80;
  server_name support.mydomain.com
  rewrite ^ https://$http_host$request_uri? permanent;
}

server {
  listen 443;
  ssl on;
  ssl_certificate /etc/ssl/fullchain.pem;
  ssl_certificate_key /etc/ssl/privkey.pem;

  server_name support.mydomain.com;
  root /var/www/support;
  index index.php;

 

 location / {
    try_files $uri $uri/ @rewrite;
  }

  location @rewrite {
    rewrite ^(.*)$ /index.php;
  }

  location ~ \.php$ {
    #fastcgi_split_path_info ^(.+\.php)(/.+)$;
    fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
    fastcgi_index index.php;
    fastcgi_param SCRIPT_FILENAME /var/www/support/$fastcgi_script_name;
    include fastcgi_params;
  }
}
 



#8 Jack

Jack

    Project Founder

  • Administrators
  • 673 posts
  • LocationAustralia

Posted 13 July 2016 - 09:07 PM

This is similar to what I've used in the past for nginx:

server {
    listen 443 http2;

    server_name sub.example.com;
    root /path/to/traq;
    index index.php;

    location / {
        try_files $uri $uri/ @rewrite;
    }

    location @rewrite {
        rewrite ^(.*)$ /index.php;
    }

    location ~ \.php$ {
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        fastcgi_pass unix:/run/php/php-fpm.sock;
        fastcgi_index index.php;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        include fastcgi_params;
    }
}



0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users