bcosca / fatfree

A powerful yet easy-to-use PHP micro-framework designed to help you build dynamic and robust Web applications - fast!
2.66k stars 446 forks source link

Persistent 404 for v3.6.4 #1145

Closed aingelc12ell closed 4 years ago

aingelc12ell commented 5 years ago

I am trying to run the demo that came with v3.6 after trying to deploy the project I've developed with F3. On my Windows dev machine, everything is a breeze. But on my Debian system, error 404 never left the page.

On my Debian server, I am running Apache(:8080) at the back of Nginx(:80) as proxy. PHP is running alongside Apache. I have the following config files:

Nginx:

server {
  listen 80;
  server_name f3.systems.com;
  root /var/www/html/;
  index index.php;
  location / {
#    index index.php;
#    try_files $uri /index.php?$query_string;
        try_files $uri $uri/ @backend;
 }
    location @backend {
        proxy_set_header X-Real-IP  $remote_addr;
        proxy_set_header X-Forwarded-For $remote_addr;
        proxy_set_header Host $host;
        proxy_pass http://127.0.0.1:8080;
    }
    location ~ \.php$ {
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $remote_addr;
        proxy_set_header Host $host;
        proxy_pass http://127.0.0.1:8080;
#       fastcgi_pass 127.0.0.1:8080;
#        fastcgi_index index.php;
#        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
#        include fastcgi_params;
    }
}

Apache:

<VirtualHost 127.0.0.1:8003>
        ServerAdmin sysadmin@systems.com
        DocumentRoot "/var/www/html"
        <Directory "/var/www/html/">
           Options Indexes FollowSymLinks Includes MultiViews
           AllowOverride All
           Order allow,deny
                Allow from all
                Require all granted
        </Directory>
        ErrorLog ${APACHE_LOG_DIR}/reports-error.log
        CustomLog ${APACHE_LOG_DIR}/reports-access.log combined
</VirtualHost>

I will appreciate very much if you could lead me where could be the issue. I have tried the config on the documentation, to no avail. Other projects are running just fine on the server so we're assured that the system can serve pages as intended.

pauljherring commented 5 years ago

What have you got redirecting virtual paths back to index.php so the routing can take over?

e.g. this: https://fatfreeframework.com/3.6/routing-engine#SampleApacheConfiguration

On Thu, Mar 21, 2019 at 2:02 AM Aingel notifications@github.com wrote:

I am trying to run the demo that came with v3.6 after trying to deploy the project I've developed with F3. On my Windows dev machine, everything is a breeze. But on my Debian system, error 404 never left the page.

On my Debian server, I am running Apache(:8080) at the back of Nginx(:80) as proxy. PHP is running alongside Apache. I have the following config files:

Nginx:

server { listen 80; server_name f3.systems.com; root /var/www/html/; index index.php; location / {

index index.php;

try_files $uri /index.php?$query_string;

    try_files $uri $uri/ @backend;

} location @backend { proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $remote_addr; proxy_set_header Host $host; proxy_pass http://127.0.0.1:8080; } location ~ .php$ { proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $remote_addr; proxy_set_header Host $host; proxy_pass http://127.0.0.1:8080;

fastcgi_pass 127.0.0.1:8080;

fastcgi_index index.php;

fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;

include fastcgi_params;

}

}

Apache:

<VirtualHost 127.0.0.1:8003> ServerAdmin sysadmin@systems.com DocumentRoot "/var/www/html" <Directory "/var/www/html/"> Options Indexes FollowSymLinks Includes MultiViews AllowOverride All Order allow,deny Allow from all Require all granted ErrorLog ${APACHE_LOG_DIR}/reports-error.log CustomLog ${APACHE_LOG_DIR}/reports-access.log combined

I will appreciate very much if you could lead me where could be the issue. I have tried the config on the documentation, to no avail. Other projects are running just fine on the server so we're assured that the system can serve pages as intended.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/bcosca/fatfree/issues/1145, or mute the thread https://github.com/notifications/unsubscribe-auth/ADweLovntyisnMg3INClPEY6Ybsx7kRlks5vYugpgaJpZM4cAmHV .

-- PJH