Initial install - infinite loop login page (GET /api/v1/oauth.json?_=xxx)

50 views
Skip to first unread message

Wim Van Dijck

unread,
Apr 7, 2020, 12:37:50 AM4/7/20
to Restya
Hi

FreeBSD 12.1
Nginx 1.16.1

Upan first login, I see the following in nginx access log
104.174.250.125 - - [06/Apr/2020:21:49:18 +0000] "GET /api/v1/oauth.json?_=1586209757997 HTTP/2.0" 200 443521 "https://board/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Safari/537.36"
104.174.250.125 - - [06/Apr/2020:21:49:19 +0000] "GET /api/v1/oauth.json?_=1586209758858 HTTP/2.0" 200 443521 "https://board/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Safari/537.36"
104.174.250.125 - - [06/Apr/2020:21:49:20 +0000] "GET /api/v1/oauth.json?_=1586209759712 HTTP/2.0" 200 443521 "https://board/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Safari/537.36"

etc etc

nginx config:

server {
        #listen 80 default_server;
        listen 443 ssl http2; # we enable HTTP/2 here (previously SPDY)
        server_name board.awaca.be; # this domain must match Common Name (CN) in the SSL certificate


        root /usr/local/www/board;
        index  index.html index.php;

        gzip on;
        gzip_disable "msie6";

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

        client_max_body_size 300M;

        rewrite ^/oauth/authorize$ /server/php/authorize.php last;
        rewrite ^/oauth_callback/([a-zA-Z0-9_\.]*)/([a-zA-Z0-9_\.]*)\$ /server/php/oauth_callback.php?plugin=\$1&code=\$2 last;
        rewrite ^/download/([0-9]*)/([a-zA-Z0-9_\.]*)\$ /server/php/download.php?id=\$1&hash=\$2 last;
        rewrite ^/ical/([0-9]*)/([0-9]*)/([a-z0-9]*).ics\$ /server/php/ical.php?board_id=\$1&user_id=\$2&hash=\$3 last;
        rewrite ^/api/(.*)$ /server/php/R/r.php?_url=\$1&\$args last;
        rewrite ^/api_explorer/api-docs/$ /client/api_explorer/api-docs/index.php last;

        location / {
                root /usr/local/www/board/client;
        }

        location /server/ {
                root /usr/local/www/board;
        }

        location ~ \.php\$ {
                try_files \$uri =404;
                include fastcgi_params;
                fastcgi_index   index.php;
                fastcgi_pass php_workers;
                fastcgi_param   SCRIPT_FILENAME \$document_root\$fastcgi_script_name;
                fastcgi_param   PHP_VALUE "upload_max_filesize=80M \n post_max_size=120M \n max_execution_time=200 \n max_input_time=200 \n memory_limit=256M";
        }

        location ~* \.(css|js|less|html|ttf|woff|jpg|jpeg|gif|png|bmp|ico) {
               root /usr/local/www/board/client;
                if (-f \$request_filename) {
                        break;
                }
                rewrite ^/img/([a-zA-Z_]*)/([a-zA-Z_]*)/([a-zA-Z0-9_\.]*)\$ /server/php/image.php?size=\$1&model=\$2&filename=\$3 last;
                add_header        Cache-Control public;
                add_header        Cache-Control must-revalidate;
                expires           7d;
        }
}

I had to add the /server/ block otherwise it would send me to /client/server/ 

Any pointers? What did I do wrong?
Cheers,
Wim

Restya

unread,
Apr 7, 2020, 12:51:03 AM4/7/20
to Restya
Please remove the /server/ block and restart the Nginx server and it would not redirected to /client/server/ and it will work correctly.

Thanks,
Restya Support

Wim Van Dijck

unread,
Apr 8, 2020, 12:26:54 AM4/8/20
to Restya
Hi ,

thanks for the answer. 

==> /var/log/nginx/error.log <==
2020/04/07 23:35:27 [error] 55275#101507: *865 open() "/usr/local/www/board/client/server/php/R/r.php" failed (2: No such file or directory), client: 104.174.250.125, server: board, request: "GET /api/v1/oauth.json?_=1586302527606 HTTP/2.0", host: "board", referrer: "https://board"

==> /var/log/nginx/access.log <==
104.174.250.125 - - [07/Apr/2020:23:35:27 +0000] "GET /api/v1/oauth.json?_=1586302527606 HTTP/2.0" 404 146 "https://board" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.1 Safari/605.1.15"
 
This in ifinite loop

Now nginx config is 

Enter code here...        location / {
                root /usr/local/www/board/client;
        }

        #location /server/ {
        #        root /usr/local/www/board;
        #}

        location ~ \.php\$ {
                try_files \$uri =404;
                include fastcgi_params;
                fastcgi_index   index.php;
                fastcgi_pass php_workers;
                fastcgi_param   SCRIPT_FILENAME \$document_root\$fastcgi_script_name;
                fastcgi_param   PHP_VALUE "upload_max_filesize=80M \n post_max_size=120M \n max_execution_time=200 \n max_input_time=200 \n memory_limit=256M";
        }

        location ~* \.(css|js|less|html|ttf|woff|jpg|jpeg|gif|png|bmp|ico) {
                root /usr/local/www/board/client;
                if (-f \$request_filename) {
                        break;
                }
                rewrite ^/img/([a-zA-Z_]*)/([a-zA-Z_]*)/([a-zA-Z0-9_\.]*)\$ /server/php/image.php?size=\$1&model=\$2&filename=\$3 last;
                add_header        Cache-Control public;
                add_header        Cache-Control must-revalidate;
                expires           7d;

(only commented out /server/ block)

Restya

unread,
Apr 8, 2020, 9:34:00 AM4/8/20
to Restya

Please remove the  /server/ block in Restyaboard configuration file and restart the Nginx server and please tell us if the Restyaboard is loading and can you please tell us your OS name as we are using the same Nginx configuration, we haven't had any problems while loading the Restyaboard URL.

Wim Van Dijck

unread,
Apr 9, 2020, 12:38:15 AM4/9/20
to Restya
Hi,

i have removed the block. That was the output of it.
The location of the restya app is /usr/local/www/board

I also tried copying the diagnostics.php file to /client/ but it seems the php is downloaded instead of executed.
Any hints?

FreeBSD 12.1
Nginx 1.16.1

Restya

unread,
Apr 11, 2020, 4:27:34 AM4/11/20
to Restya


On Thursday, April 9, 2020 at 10:08:15 AM UTC+5:30, Wim Van Dijck wrote:
Hi,

i have removed the block. That was the output of it.
The location of the restya app is /usr/local/www/board

I also tried copying the diagnostics.php file to /client/ but it seems the php is downloaded instead of executed.
Any hints?

FreeBSD 12.1
Nginx 1.16.1

Please use our configuration from our GitHub repository link https://github.com/RestyaPlatform/board/blob/dev/restyaboard.conf to configure Restyaboard and please  tell us if the issue reoccurs?
Reply all
Reply to author
Forward
0 new messages