3.x on Nginx

Support for Traq 3.x
Post Reply
User avatar
Harold
Newbie
Posts: 2
Joined: Thu May 09, 2013 10:34 pm

3.x on Nginx

Post by Harold » Thu May 09, 2013 11: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?

User avatar
Jack
Advanced Member
Posts: 666
Joined: Fri Mar 27, 2009 7:37 pm
Location: Australia

Re: 3.x on Nginx

Post by Jack » Fri May 10, 2013 12:02 am

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


Code: Select all


location / {

  try_files $uri $uri/ @rewrite;

}

location @rewrite {

  rewrite ^(.*)$ /index.php;

}

Last edited by Jack on Fri May 10, 2013 8:42 pm, edited 1 time in total.

User avatar
Harold
Newbie
Posts: 2
Joined: Thu May 09, 2013 10:34 pm

Re: 3.x on Nginx

Post by Harold » Sun May 12, 2013 8:24 am

Thanks Jack, that fixed it!

User avatar
echi
Newbie
Posts: 2
Joined: Sat Nov 23, 2013 8:02 am

Re: 3.x on Nginx

Post by echi » Sat Nov 23, 2013 8:16 am

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:

Code: Select all

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

User avatar
Jack
Advanced Member
Posts: 666
Joined: Fri Mar 27, 2009 7:37 pm
Location: Australia

Re: 3.x on Nginx

Post by Jack » Thu Nov 28, 2013 3:20 am

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.

User avatar
echi
Newbie
Posts: 2
Joined: Sat Nov 23, 2013 8:02 am

Re: 3.x on Nginx

Post by echi » Wed Oct 15, 2014 4:53 am

Hello!
 
traq in a subdir served with nginx can be done with

Code: Select all

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


User avatar
pauloklaus
Newbie
Posts: 1
Joined: Wed Jul 13, 2016 11:12 pm

Re: 3.x on Nginx

Post by pauloklaus » Wed Jul 13, 2016 11: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;

  }

}

 
Last edited by pauloklaus on Wed Jul 13, 2016 11:27 pm, edited 1 time in total.

User avatar
Jack
Advanced Member
Posts: 666
Joined: Fri Mar 27, 2009 7:37 pm
Location: Australia

Re: 3.x on Nginx

Post by Jack » Thu Jul 14, 2016 7:07 am

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

Code: Select all

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;
    }
}

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest