Hello, I'm trying to make my url resolver on nginx see the get parameters. Neither localhost:8080/test/action/param1/1 nor localhost:8080/test/action/?param1=1 seem to work.
I'm checking if it works this way:
public function testAction()
{
var_dump($this->request->get());
exit;
}
I tried all the configurations available in docs. My current one is:
server { listen 80 default_server; listen [::]:80 default_server ipv6only=on;
root /vagrant/seyo/public; index index.html index.htm index.php; # Make site accessible from https://localhost/ server_name 127.0.0.1; location /phpmyadmin { root /usr/share/; index index.php index.html index.htm; location ~ ^/phpmyadmin/(.+\.php)$ { try_files $uri =404; root /usr/share/; fastcgi_pass unix:/run/php5-fpm.sock; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include /etc/nginx/fastcgi_params; } location ~* ^/phpmyadmin/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ { root /usr/share/; } } location /phpMyAdmin { rewrite ^/* /phpmyadmin last; } location / { # if file exists return it right away if (-f $request_filename) { break; } # otherwise rewrite it if (!-e $request_filename) { rewrite ^(.+)$ /index.php?_url=$1 last; break; } } location ~ \.php$ { try_files $uri =404; fastcgi_split_path_info ^(.+\.php)(/.+)$; #fastcgi_pass 127.0.0.1:9000; fastcgi_pass unix:/run/php5-fpm.sock; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } location ~* ^/(css|img|js|flv|swf|download)/(.+)$ { root /vagrant/seyo/public; } location ~ /\.ht { deny all; }
}
Update: It seems that it doesn't show ANY parameters. $_GET is also empty. It works only in default index under '/' path My url resolving:
$di->set('router', function() { $router = new Router();
$router->setUriSource(\Phalcon\Mvc\Router::URI_SOURCE_SERVER_REQUEST_URI);
$router->removeExtraSlashes(true);
$router->add('/{lang:[a-z]{2}}/:controller/:action/:params', array(
'lang' => 1,
'controller' => 2,
'action' => 3,
'params' => 4,
));
$router->add('/{lang:[a-z]{2}}/:controller/:action', array(
'lang' => 1,
'controller' => 2,
'action' => 3,
));
$router->add('/{lang:[a-z]{2}}/:controller', array(
'lang' => 1,
'controller' => 2,
'action' => 'index',
));
$router->add('/{lang:[a-z]{2}}', array(
'lang' => 1,
'controller' => 'index',
'action' => 'index',
));
return $router;
});
But it works well on xampp
Another example
on localhost:8080/?test=1
$this->request->get() works fine, but on:
localhost:8080/index/index?test=1
the $this->request->get() array is empty