Get url non fonctionnel symfony

Résolu
Chirikumo -  
 Chirikumo -

Bonjour,

J'ai un petit soucis, la méthode get en passant dans l'url n'est pas reconnue sur d'autres routes que la home '/'
exemple: /test?foo=bar

Quand je dump $_GET sur ma route home 'website.domain?foo=bar' j'obtiens bien foo=bar mais lorsque je $_GET sur une autre route comme 'website.domain/test?foo=bar' je n'obtiens rien dans mon dump de $_GET, un tableau vide m'est retourné.

[EDIT] En local tout fonctionne normalement, c'est sur serveur j'ai ce soucis.


Je ne trouve aucune solution sur internet, peut être ma recherche est mauvaise. Avez-vous des idées ?

1 réponse

  1. Chirikumo
     

    J'ai trouvé mon problème, c'était ma configuration Nginx qui n'était pas correcte.

    Ma nouvelle configuration si ça peut aider:

    nginx.conf
    ```conf
    server {
        #proxy_cache cache;
        #proxy_cache_valid 200 1s;
        listen 8080;
        listen [::]:8080;
        root /home/site/wwwroot/public;
        index  index.php index.html index.htm;
        server_name  example.com www.example.com; 
        port_in_redirect off;
        client_max_body_size 1000M;

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

        error_page 404 /index.php;
       
        # Disable .git directory
        location ~ /\.git {
            deny all;
            access_log off;
            log_not_found off;
        }

        # Add locations of phpmyadmin here.
        location ~ ^/index\.php(/|$) {
            try_files $uri =404;
            fastcgi_index index.php;
            fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
            fastcgi_pass 127.0.0.1:9000;
            include fastcgi_params;
            fastcgi_param HTTP_PROXY "";
            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
            fastcgi_param PATH_INFO $fastcgi_path_info;
            fastcgi_param QUERY_STRING $query_string;
            fastcgi_intercept_errors on;
            fastcgi_connect_timeout         300; 
            fastcgi_send_timeout           3600; 
            fastcgi_read_timeout           3600;
            fastcgi_buffer_size 128k;
            fastcgi_buffers 4 256k;
            fastcgi_busy_buffers_size 256k;
            fastcgi_temp_file_write_size 256k;
        }

        error_log /var/log/nginx/project_error.log;
        access_log /var/log/nginx/project_access.log;
    }```

    1