Closed jhnferraris closed 9 years ago
Try adding the following line above the first location
block:
index index.html index.htm index.php;
@tobscure Like so?
....
index index.html index.htm index.php;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location /api {
try_files $uri $uri/ /api.php?$query_string;
}
...
Still the same output. A white page with "Cannot GET http://dev.hostname.com"
Hmm, can you check your nginx logs and see if you can find an error message with more info?
@tobscure Sadly nothing interesting in my nginx logs that's why I'm escalating this to you guys. hehe
I don't think this is an issue with Flarum so I'm closing this. I'm afraid without more information, I don't know what else to try. @franzliedke any ideas? Maybe try increasing the verbosity of the nginx logs?
@tobscure I'm also experiencing the same issue.
I added a die() statement in the top of the index.php file, just to see if it hits the file or not, and sure enough it did. If I further edit the index.php to emit some headers, I see the following error:
Fatal error: Uncaught exception 'RuntimeException' with message 'Unable to emit response; headers already sent' in /testing/flarum/vendor/zendframework/zend-diactoros/src/Response/SapiEmitter.php:31 Stack trace: #0 /testing/flarum/vendor/zendframework/zend-diactoros/src/Server.php(170): Zend\Diactoros\Response\SapiEmitter->emit(Object(Zend\Stratigility\Http\Response), 2) #1 /testing/flarum/vendor/flarum/core/src/Http/AbstractServer.php(33): Zend\Diactoros\Server->listen() #2 /testing/flarum/index.php(16): Flarum\Http\AbstractServer->listen() #3 {main} thrown in /testing/flarum/vendor/zendframework/zend-diactoros/src/Response/SapiEmitter.php on line 31
@tobscure Accessing directly /index.php instead of just the root /, seems to give some output. However, the assets do not load when accessing thru /index.php, gives a 404 for: /index.php/assets/forum-3809febf.css
@MrNicodemuz Can you show your nginx config, so I can try to replicate. :)
Hi @jhnferraris,
Sure, see my nginx config below:
server {
error_log /var/log/nginx/discussions-platform/error.log;
access_log /var/log/nginx/discussions-platform/access.log;
set $discussions_platform_root "/Users/Admin/Projects/discussions-platform/flarum";
set $discussions_platform_fastcgi "127.0.0.1:9000";
listen 80;
server_name
discussions.com
;
root $discussions_platform_root;
index index.php;
location / { try_files $uri $uri/ /index.php?$query_string; }
location /api { try_files $uri $uri/ /api.php?$query_string; }
location /admin { try_files $uri $uri/ /admin.php?$query_string; }
location /flarum {
deny all;
return 404;
}
location ~ .php$ {
fastcgi_split_path_info ^(.+.php)(/.+)$;
fastcgi_pass $discussions_platform_fastcgi;
fastcgi_param SCRIPT_FILENAME $discussions_platform_root$fastcgi_script_name;
fastcgi_index index.php;
include fastcgi_params;
}
location ~* \.html$ {
expires -1;
}
location ~* \.(css|js|gif|jpe?g|png)$ {
expires 1M;
add_header Pragma public;
add_header Cache-Control "public, must-revalidate, proxy-revalidate";
}
gzip on;
gzip_http_version 1.1;
gzip_vary on;
gzip_comp_level 6;
gzip_proxied any;
gzip_types application/atom+xml
application/javascript
application/json
application/vnd.ms-fontobject
application/x-font-ttf
application/x-web-app-manifest+json
application/xhtml+xml
application/xml
font/opentype
image/svg+xml
image/x-icon
text/css
text/plain
text/xml;
gzip_buffers 16 8k;
gzip_disable "MSIE [1-6]\.(?!.*SV1)";
}
Hi @jhnferraris, were you able to replicate the problem?
@jhnferraris make sure that the url
in \config.php
does not end with index
.
This erroneous url may been set with a bad nginx configuration.
I installed Flarum in my local machine using the CLI as instructed here. http://flarum.org/docs/installation/
I have my nginx config here:
I have also set my
/etc/hosts
I have successfully run
flarum/flarum install
But when I ran dev.hostname.com in my web browser. It returned "Cannot GET http://dev.hostname.com"
Currently, I've tried chmod on the project folder with 777 (this includes
flarum/storage
) but no progress so far.What am I missing here?