Nginx configuration and Aura router

46 views
Skip to first unread message

Andy Beak

unread,
May 4, 2017, 8:06:07 AM5/4/17
to The Aura Project for PHP
Hi,

I'm trying to get the current version of the Aura router working with nginx.

I'm using the nginx config from the documentation and trying to get the closure route from https://github.com/auraphp/Aura.Router/blob/3.x/docs/getting-started.md working.

When I visit http://localhost:8080/blog/12 I get the message "You asked for blog entry 0.".

I'm nearly certain that this is an nginx config issue.

My nginx config looks like this:

server {
    listen   80;
    root /code/public;
    index index.php index.html index.htm;
    server_name localhost;

    error_log  /var/log/nginx/error.log;
    access_log /var/log/nginx/access.log;

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

    error_page 404 /404.html;

    location ~ \.php$ {

        fastcgi_param  SCRIPT_FILENAME    $document_root$fastcgi_script_name;
        fastcgi_param  QUERY_STRING       $query_string;
        fastcgi_param  REQUEST_METHOD     $request_method;
        fastcgi_param  CONTENT_TYPE       $content_type;
        fastcgi_param  CONTENT_LENGTH     $content_length;

        fastcgi_param  SCRIPT_NAME        $fastcgi_script_name;
        fastcgi_param  REQUEST_URI        $request_uri;
        fastcgi_param  DOCUMENT_URI       $document_uri;
        fastcgi_param  DOCUMENT_ROOT      $document_root;
        fastcgi_param  SERVER_PROTOCOL    $server_protocol;
        fastcgi_param  HTTPS              $https if_not_empty;

        fastcgi_param  GATEWAY_INTERFACE  CGI/1.1;
        fastcgi_param  SERVER_SOFTWARE    nginx/$nginx_version;

        fastcgi_param  REMOTE_ADDR        $remote_addr;
        fastcgi_param  REMOTE_PORT        $remote_port;
        fastcgi_param  SERVER_ADDR        $server_addr;
        fastcgi_param  SERVER_PORT        $server_port;
        fastcgi_param  SERVER_NAME        $server_name;

        # PHP only, required if PHP was built with --enable-force-cgi-redirect
        fastcgi_param  REDIRECT_STATUS    200;

        fastcgi_pass php:9000;
        try_files $uri =404;
    }
}


Hari K T

unread,
May 4, 2017, 2:30:54 PM5/4/17
to aur...@googlegroups.com
Hi, 
 
I'm trying to get the current version of the Aura router working with nginx.

I'm using the nginx config from the documentation and trying to get the closure route from https://github.com/auraphp/Aura.Router/blob/3.x/docs/getting-started.md working.

When I visit http://localhost:8080/blog/12 I get the message "You asked for blog entry 0.".


In the nginx configuration you are listening to port 80 and in the url you mentioned about 8080 .  Is that a typo or are you using the php 's default webserver for one ?
 

--
You received this message because you are subscribed to the Google Groups "The Aura Project for PHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to auraphp+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Andy Beak

unread,
May 5, 2017, 7:42:00 AM5/5/17
to The Aura Project for PHP
Hi,

Not a typo, I'm running Nginx in docker and exposing port 80 on 8080.  I can see the output from the server, it's just not getting the variable correct.  

Thanks,
 Andy
To unsubscribe from this group and stop receiving emails from it, send an email to auraphp+u...@googlegroups.com.

Hari K T

unread,
May 5, 2017, 8:29:57 AM5/5/17
to aur...@googlegroups.com
Hi, 

I believe you are the same person who asked at stackoverflow.

For the record or if you are not person, I have written over : http://stackoverflow.com/a/43804969/487878

Thank you.

Hari K T

You can ring me : +91 9388 75 8821

Skype  : kthari85
Twitter : harikt

To unsubscribe from this group and stop receiving emails from it, send an email to auraphp+unsubscribe@googlegroups.com.

Andy Beak

unread,
May 5, 2017, 11:30:33 AM5/5/17
to The Aura Project for PHP
I am, thanks Hari
Reply all
Reply to author
Forward
0 new messages