FINALLY!!! after long hours of debugging I fixed it here is the explanation,
Since again I am using http://easyengine.io for my wordpress main site and I want to install flarum in the sub directory. there are already configurations from the easyengine that is the same with the config on flarum so I needed to dig into their files since they organize the folders the used 'Include' so I needed to dig into all that files and see which code is already there from the original code of flarum that is located here http://flarum.org/docs/installation/
BEFORE
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 unix:/var/run/php5-fpm.sock;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param HTTP_PROXY ""; # Fix for https://httpoxy.org/ vulnerability
fastcgi_index index.php;
}
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)";
this is the only code I needed to paste ony my /etc/nginx/mydomain.com
location /forum/ {
try_files $uri $uri/ /forum/index.php?$args;
location /forum/ { try_files $uri $uri/ /forum/index.php?$query_string; }
location /forum/api { try_files $uri $uri/ /forum/api.php?$query_string; }
location /forum/admin { try_files $uri $uri/ /forum/admin.php?$query_string; }
}
to they trim all down all the other codes since again they organized it to different files and folders ?
also thanks to this site he has the right code for me http://shinyidol.us/2016/05/30/setup-flarum-on-digital-ocean/
but then he didn't explain too much of the procedure since he uses digital ocean and I use linode server and I think his tutorial if for fresh install.
I'll try to do a tutorial soon for people who has the same scenario of using Easyengine and Flarum for their sub directory
thanks for all the feedbacks and help ?