Nginx - Bad response error when try to login

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Jaime Fernandez
    Junior Member
    • Sep 2014
    • 6

    Nginx - Bad response error when try to login

    Hi! After complete the installation I've got a "Bad response error" when I try to login. It seems that the request:

    /espocrm/api/v1/App/user

    get the "Welcome" message from Nginx as response.

    I suppose that I've a problem with my Nginx configuration.

    Thanks for your help.
  • tarasm
    Super Moderator
    • Mar 2014
    • 573

    #2
    Hi Jaime,

    Did you add this configuration for your nginx host config inside "server" block:
    Code:
    location /api/v1/ {
        if (!-e $request_filename){
            rewrite ^/api/v1/(.*)$ /api/v1/index.php last; break;
        }
    }
    
    location / {
        rewrite reset/?$ reset.html break;
    }
    
    location ^~ (data|api)/ {
        if (-e $request_filename){
            return 403;
        }
    }
    
    location ^~ /data/logs/ {
        return 403;
    }
    location ^~ /data/config.php {
        return 403;
    }
    location ^~ /data/cache/ {
        return 403;
    }
    location ^~ /data/upload/ {
        return 403;
    }
    location ^~ /application/ {
        return 403;
    }
    location ^~ /custom/ {
        return 403;
    }
    location ^~ /vendor/ {
        return 403;
    }
    Last edited by tarasm; 09-15-2014, 09:30 AM.
    Job Offers and Requests

    Comment

    • Jaime Fernandez
      Junior Member
      • Sep 2014
      • 6

      #3
      Hi!
      Thanks! It works now, I needed to add that and it seems that it can't work with /espocrm/ relative path...

      Best regards

      Comment

      • alasdaircr
        Active Community Member
        • Aug 2014
        • 525

        #4
        Can someone post their full configuration for Espo under nginx? If I use this, index.php is downloaded rather than executed. Using php-fpm.

        Comment

        • Jaime Fernandez
          Junior Member
          • Sep 2014
          • 6

          #5
          You need to add this

          Code:
          location ~ \.php$ {
              fastcgi_split_path_info ^(.+\.php)(/.+)$;
              fastcgi_pass unix:/var/run/php5-fpm.sock;
              fastcgi_index index.php;
              include fastcgi_params;
          }

          Comment

          • alasdaircr
            Active Community Member
            • Aug 2014
            • 525

            #6
            Yeah I have that already. Will revert to what I had working

            Comment

            Working...