[nginx config SOLVED] - TL is redirected ALWAYS to https

Ask community to help.

Moderators: Amaradana, TurboPT, TL Developers

[nginx config SOLVED] - TL is redirected ALWAYS to https

Postby saiq » Sun Aug 05, 2012 1:56 pm

Hi all,

I'm using nginx 1.1 + php5.3 in ubuntu 12.04.
After I finished the testlink installation, I cannot access testlink, cause it is redirected to https automaticlly.

I found that:
1. If I try to access http://xxx.com/testlink/index.php, it will be redirect to https://xxx.com/testlink/login.php?note=expired
2. If I access http://xxx.com/testlink/login.php, it will not be redirected. But the logo image can not be found, it has been redirected to https://xxx.com/testlink/gui/themes/default/images/company_logo.png
3. I access other application in the website, they are not redirected to https.

Is this a testlink issue?
saiq
TestLink user
 
Posts: 5
Joined: Sat Aug 04, 2012 7:26 am

Re: Testlink is redirected to https automaticlly

Postby fman » Mon Aug 06, 2012 8:37 am

No AFAIK, IMHO is something on your webserver config
fman
Member of TestLink Community
 
Posts: 3063
Joined: Tue Nov 15, 2005 7:19 am

Re: Testlink is redirected to https automaticlly

Postby saiq » Mon Aug 06, 2012 11:22 am

virtual host
Code: Select all
server {
    listen   80;
    server_name  xxx.com;
    root /usr/share/nginx/xxx.com;
    index index.html index.htm index.php;

    access_log  /var/log/nginx/xxx.com.access.log main;
    error_log   /var/log/nginx/xxx.com.error.log;

    location = /favicon.ico {
        log_not_found off;
        access_log off;
    }

    location = /robots.txt {
        allow all;
        log_not_found off;
        access_log off;
    }

    location / {
        try_files $uri $uri/ /index.html;
    }

    location ~ \.php$ {
        try_files $uri =404;
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        #fastcgi_pass   127.0.0.1:9000;
        fastcgi_pass unix:/var/run/php5-fpm.sock;
        fastcgi_index   index.php;
        include fastcgi_params;
    }

    location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
        expires 30d;
        log_not_found off;
    }
}



nginx.conf
Code: Select all
root@ubuntu:/etc/nginx# cat nginx.conf | grep -v ^#
user www-data;
worker_processes 4;
pid /var/run/nginx.pid;

events {
        worker_connections 768;
        # multi_accept on;
}

http {

        ##
        # Basic Settings
        ##

        sendfile on;
        tcp_nopush on;
        tcp_nodelay on;
        keepalive_timeout 2;
        types_hash_max_size 2048;
        # server_tokens off;

        # server_names_hash_bucket_size 64;
        # server_name_in_redirect off;

        include /etc/nginx/mime.types;
        default_type application/octet-stream;

        ##
        # Logging Settings
        ##

        log_format main '$remote_addr - $remote_user [$time_local] $status'
        '"$request" $body_bytes_sent "$http_referer"'
        '"$http_user_agent" "$http_x_forwarded_for"';

        access_log /var/log/nginx/access.log main;
        error_log /var/log/nginx/error.log;

        ##
        # Gzip Settings
        ##

        gzip on;
        gzip_disable "msie6";

        # gzip_vary on;
        # gzip_proxied any;
        # gzip_comp_level 6;
        # gzip_buffers 16 8k;
        # gzip_http_version 1.1;
        # gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;

        ##
        # nginx-naxsi config
        ##
        # Uncomment it if you installed nginx-naxsi
        ##

        #include /etc/nginx/naxsi_core.rules;

        ##
        # nginx-passenger config
        ##
        # Uncomment it if you installed nginx-passenger
        ##

        #passenger_root /usr;
        #passenger_ruby /usr/bin/ruby;

        ##
        # Virtual Host Configs
        ##

        include /etc/nginx/conf.d/*.conf;
        include /etc/nginx/sites-enabled/*;
}



These are nginx configuration files.
If I install another php application in the host(eg. wordpress), I will not see the issue.
saiq
TestLink user
 
Posts: 5
Joined: Sat Aug 04, 2012 7:26 am

Re: Testlink is redirected to https automaticlly

Postby GunnarD » Mon Aug 06, 2012 1:39 pm

Must be something in your server or client.

I did just a clean install of testlink 1.9.3 on my server (Fedora 17, nginx 1.0.15, php 5.4.5) and no redirection happens.

You have a PM with the adress to my development server, do you get a redirection there?
GunnarD
 

Re: Testlink is redirected to https automaticlly

Postby saiq » Mon Aug 06, 2012 1:54 pm

GunnarD wrote:Must be something in your server or client.

I did just a clean install of testlink 1.9.3 on my server (Fedora 17, nginx 1.0.15, php 5.4.5) and no redirection happens.

You have a PM with the adress to my development server, do you get a redirection there?


Thanks for your reply.
I could access the URL in the PM and it didn't be redirected to https.
:wink:
saiq
TestLink user
 
Posts: 5
Joined: Sat Aug 04, 2012 7:26 am

Re: Testlink is redirected to https automaticlly

Postby saiq » Tue Aug 07, 2012 1:47 am

I installed LNMP in Ubuntu 12.04 with these commands:

Code: Select all
apt-get install nginx
apt-get install mysql-server mysql-client
apt-get install php5-fpm php5-mysql


After installation was complete, I modified the default host configuration file (/etc/nginx/site-available/default ) to get support php in nginx.
Then I did a clean install of testlink 1.9.3 and the redirection issue was happened.
saiq
TestLink user
 
Posts: 5
Joined: Sat Aug 04, 2012 7:26 am

Re: Testlink is redirected to https automaticlly

Postby GunnarD » Tue Aug 07, 2012 5:33 am

U have something in /etc/nginx/conf.d/*.conf ?
GunnarD
 

Re: Testlink is redirected to https automaticlly

Postby saiq » Tue Aug 07, 2012 6:19 am

GunnarD wrote:U have something in /etc/nginx/conf.d/*.conf ?


Nothing, it's an empty directory.
saiq
TestLink user
 
Posts: 5
Joined: Sat Aug 04, 2012 7:26 am

Re: Testlink is redirected to https automaticlly

Postby fman » Tue Aug 07, 2012 7:01 am

best suggestion is install in a completely different environment => get XAMPP or LAMMP and do fresh install there
I've installed 1.9.3 FRESH on a serve with nginx, and have no issue.
Because this is happening when you access index.php, and not when to access login.php, this seems to be a nginx config issue => time
to go for help on nginx site
fman
Member of TestLink Community
 
Posts: 3063
Joined: Tue Nov 15, 2005 7:19 am

Re: Testlink is redirected to https automaticlly

Postby Anae » Tue Aug 14, 2012 8:28 am

Hi, I have the same problem after installing testlink with nginx. The testlink is redirected to https automatically.
I have fixed the problem configuring the file /etc/nginx/sites-available/<server-name>. In this file, you need to add the following code:
Code: Select all
location ~ ^/testlink.*\.php$ {
                include /etc/nginx/fastcgi_params;
                fastcgi_pass  127.0.0.1:8888;
                fastcgi_index index.php;
                fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                fastcgi_param HTTPS off;
 }
Anae
TestLink user
 
Posts: 1
Joined: Thu Aug 09, 2012 8:00 am

Re: Testlink is redirected to https automaticlly

Postby fman » Tue Aug 14, 2012 9:34 am

THANKS a lot to Anae!!!
fman
Member of TestLink Community
 
Posts: 3063
Joined: Tue Nov 15, 2005 7:19 am


Return to Installation and configuration



Who is online

Users browsing this forum: No registered users and 3 guests