Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

503 error on nginx/php-fpm using your config #117

Closed
EnMod opened this issue Dec 23, 2014 · 5 comments
Closed

503 error on nginx/php-fpm using your config #117

EnMod opened this issue Dec 23, 2014 · 5 comments

Comments

@EnMod
Copy link

EnMod commented Dec 23, 2014

Basically, I have a similar issue as described in #71, where I type in admin/admin and get kicked back. The thing is, I get the "API Error. Ensure api directory is writeable." message above login, checking console shows this:
POST http://taskboard.mydomain.com/api/login 503 (Service Unavailable)

Bear in mind, permissions for the api folder are set correctly. The only things I've changed from your config were what needed to be changed to fit my Arch/nginx/php-fpm setup. here's my conf for the server (domain names changed to protect the innocent):

server {
    listen 80 default_server;
    listen [::]:80 default_server ipv6only=on;

    root /path/to/taskboard;
    index index.php index.html;

    # Make site accessible from http://localhost/
    server_name localhost;

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

    location /api {
        if (!-e $request_filename) {
            rewrite ^(.*)$ /api/api.php last; break;
        }
    }

    location /api/taskboard.db {
        rewrite ^(.*)$ /api/api.php last; break;
    }

    location ~ \.php$ {
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        # NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini

        fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_index index.php;
        include fastcgi.conf;
    }
}

All other components regarding php are going just fine on other sites I host. Any ideas?

@kiswa
Copy link
Owner

kiswa commented Dec 23, 2014

PHP version? I really have no idea about nginx; that was supplied by a contributor (@alex3305).

I'd be glad for anyone familiar with nginx setup that can take a look and figure it out.

@kiswa
Copy link
Owner

kiswa commented Dec 23, 2014

Just noticed the comment on #102 - does your setup also block the Authorization header when using FastCGI? If this is a widespread issue, I'll need to do something other than using Authorization.

@EnMod
Copy link
Author

EnMod commented Dec 23, 2014

Thanks for the timely reply! I'm running PHP version 5.6, is that too high? I had also read in other issues that users had best results with 5.5. As for the header I'm unsure how to test if the Authorization header is blocked using nginx as opposed to using Apache to figure it out.

EDIT: Welp...after setting permissions to 757 for /api and changing the user in my nginx.conf to match what I had initially set, it all works.

@kiswa
Copy link
Owner

kiswa commented Dec 27, 2014

Glad you got it working!

@kiswa kiswa closed this as completed Dec 27, 2014
@weaming
Copy link

weaming commented Feb 26, 2016

@EnMod Thank you for your config!
@kiswa I think this config should be add to README.md. I use Nginx.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants