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

symfony.conf file does not reflect the latest symfony 4 directory structure #82

Open
mohib0306 opened this issue Dec 5, 2017 · 5 comments

Comments

@mohib0306
Copy link

mohib0306 commented Dec 5, 2017

Current symfony.conf file:
`server {
server_name symfony.dev;
root /var/www/symfony/web;

location / {
    try_files $uri @rewriteapp;
}

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

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

error_log /var/log/nginx/symfony_error.log;
access_log /var/log/nginx/symfony_access.log;

} `

since /var/www/symfony/web is not the root in symfony 4, but rather /var/www/symfony/public is the root directory. When the /var/www/symfony/web is used as the root directory, navigating to the symfony.dev return "File Not Found" error page. The same thing goes for changing app.php to index.php

@maxpou
Copy link
Owner

maxpou commented Dec 5, 2017

Hi @mohib0306 ,
That's right, this stack doesn't support SF4 for now.
It is on my todo list!
Cheers

@mohib0306
Copy link
Author

It made it working by changing the symfony.conf file, so if want me to make a PR, I am happy to contribute.
Cheers

@MatthewBooth
Copy link

server {
    server_name symfony.local;
    root /var/www/symfony/public;

    location / {
        try_files $uri @rewriteapp;
    }

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

    location ~ ^/(index)\.php(/|$) {
        fastcgi_pass php-upstream;
        fastcgi_split_path_info ^(.+\.php)(/.*)$;
        include fastcgi_params;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_param HTTPS off;
    }

    error_log /var/log/nginx/symfony_error.log;
    access_log /var/log/nginx/symfony_access.log;
}

That works fine. I was going to do a PR for this but I'm still trying to figure out how to do it intelligently

@OlivierToussaint
Copy link

Thx @MatthewBooth

@Matts
Copy link

Matts commented Apr 17, 2018

I've got a API Boilerplate for Symfony 4 at https://github.com/Matts/Symfony-4-Docker-API-Boilerplate it has all the updated paths in the configurations found here

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

No branches or pull requests

5 participants