0

Heey all,

I'm trying to host my symfony project but i'm getting a 500 error back from nginx. The error log doesn't show anything. Yet the access log does show something:

46.243.152.13 - - [17/Mar/2016:14:05:45 +0100] "GET / HTTP/1.1" 500 507 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.87 Safari/537.36"

As i see the http request being done i'm getting a 500 507 back.

I've double checked the permissions on the folders and they are correct now.

How do i need to continue?

This is my hostfile from nginx:

upstream php5-fpm {
    server unix:/var/run/php5-fpm.sock; #for PHP-FPM running on UNIX socket
}

server {
    listen 80;
    server_name dev.domain.nl;
    return 301 https://$host$request_uri;
}

server {
#  listen *:80;

  listen 443 ssl;
  server_name dev.domain.nl;
  ssl_certificate path/to/fullchain;
  ssl_certificate_key path/to/key;
  ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
  ssl_prefer_server_ciphers on;
  ssl_ciphers 'EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH';
  server_tokens off;
  root /var/www/dev.domain.nl/html/web;

  client_max_body_size 250m;
  access_log /var/log/dev.domain.nl/dev_access.log;
  error_log  /var/log/dev.domain.nl/dev_error.log;

  rewrite ^/app\.php/?(.*)$ /$1 permanent;

  location / {
    index app.php;
    try_files $uri @rewriteapp;
  }

  location @rewriteapp {
    rewrite ^(.*)$ /app.php/$1 last;
  }

  location ~ ^/(app|app_dev)\.php(/|$) {
    fastcgi_pass   php5-fpm;
    fastcgi_split_path_info ^(.+\.php)(/.*)$;
    include fastcgi_params;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    fastcgi_param HTTPS on;
  }
}

Please help me out!

Baklap4
  • 127
  • 2
  • 13

2 Answers2

1

Wow such dumb from me.. It wasn't nginx who was failing. Nginx showed the actual page which needed to be viewed. It was my Symphony application showing the error when there's no return value in a controller.

The thing why it didn't get logged in my log files was because it was a symfony error. Oh my what dumb.

Baklap4
  • 127
  • 2
  • 13
0

That would be a rewrite loop:

rewrite ^/app\.php/?(.*)$ /$1 permanent;
rewrite ^(.*)$ /app.php/$1 last;

I don't know why your error log is not working for you. This is the sort of error you should be seeing in it (but with your host particulars rather than mine):

2016/03/17 14:05:03 [error] 75745#0: *23741 rewrite or internal redirection cycle while redirect to named location "@rewrite", client: 10.6.1.0, server: , request: "GET / HTTP/1.1", host: "10.3.0.3:8080"
Richard Smith
  • 12,834
  • 2
  • 21
  • 29