Quantcast
Channel: Nginx Forum - How to...
Viewing all articles
Browse latest Browse all 4759

Elgg framework not finding files from php proxy

$
0
0
Hello, I migrated serves and ditched the control panel to manage my VPS. I'm using vpssim.com LEMP stack installer. I'm getting a 404 error on groups and blog icons due to having no rules to serve the images via Elgg's proxy php script.

WEB CONSOLE
================================

[Error] Failed to load resource: the server responded with a status of 404 (Not Found) (1359374563.jpg, line 0) https://demyx.com/groupicon/7006/small/1359374563.jpg
[Error] Failed to load resource: the server responded with a status of 404 (Not Found) (1424436197.jpg, line 0) https://demyx.com/blogicon/13587/medium/1424436197.jpg

ELGG NGINX CONFIG
================================

# Elgg Nginx configuration. Customize and put into /etc/nginx/sites-enabled

server {
listen 80;
server_name example.org;

# Server root, replace it with your elgg installation location
root /srv/example.org;
index index.php index.html index.htm;

# Server logs, replace it with your project names
error_log /var/log/nginx/example_error.log;
access_log /var/log/nginx/example_access.log;

location ~ (^\.|/\.) {
return 403;
}

location /cache {
rewrite ^/cache\/(.*)$ /engine/handlers/cache_handler.php?request=$1&$query_string;
}

location /export {
rewrite ^/export\/([A-Za-z]+)\/([0-9]+)\/?$ /engine/handlers/export_handler.php?view=$1&guid=$2;
rewrite ^/export\/([A-Za-z]+)\/([0-9]+)\/([A-Za-z]+)\/([A-Za-z0-9\_]+)\/$ /engine/handlers/export_handler.php?view=$1&guid=$2&type=$3&idname=$4;
}

location = /rewrite.php {
rewrite ^(.*)$ /install.php;
}

location / {
try_files $uri $uri/ /index.php?__elgg_uri=$uri&$query_string;
}

# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
# # NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini
#
# # With php5-cgi alone:
# fastcgi_pass 127.0.0.1:9000;
# # With php5-fpm:
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
}
}

MY CONFIG
================================

server {
server_name www.demyx.com;
rewrite ^(.*) https://demyx.com$1 permanent;
}
server {
listen 80;
listen 443;
access_log off;
error_log on;
error_log /home/demyx.com/logs/error.log;
root /home/demyx.com/public_html;
include /etc/nginx/conf/ddos2.conf;
index index.php index.html index.htm;
server_name demyx.com;

ssl on;
ssl_certificate /etc/sslmate/www.demyx.com.crt;
ssl_certificate_key /etc/sslmate/www.demyx.com.key;

#///////////////////////////////////////////////////////
#///////////////////////////////////////////////////////
#Run all the websites,if you use your rule, comment or delete the line below (AAA)
#include /etc/nginx/conf/all.conf;

#If you use your rule, comment or delete above line, and Uncoment 3 lines belows and set your rule within it.. (BBB)
#location / {
#Uncomment 3 lines and set your rules here!
#}

# Rule cho wordpress + Plugin wp super cache. (CCC)
#include /etc/nginx/conf/supercache.conf;

# Rule cho wordpress + Plugin W3 Total Cache. (DDD)
#include /etc/nginx/conf/w3totalcache.conf;

#Do not delete the bottom line, if you delete google pagespeed function will not work!!
include /etc/nginx/ngx_pagespeed.conf;

#security, sql injection Propeller ....(uncoment if you want to use). Because some website plugins do not run with this config, so VPSSIM to turn off default
#include /etc/nginx/conf/block.conf;

location ~ (^\.|/\.) {
return 403;
}

location ^~ /cache {
rewrite ^/cache\/(.*)$ /engine/handlers/cache_handler.php?request=$1&$query_string;
}

#location ^~ /groupicon {
# rewrite /groupicon\/(.*)$ /engine/handlers/cache_handler.php?request=$1&$query_string;
#return "groupicon/$group->guid/$size/$icontime.jpg";
#}

location /export {
rewrite ^/export\/([A-Za-z]+)\/([0-9]+)\/?$ /engine/handlers/export_handler.php?view=$1&guid=$2;
rewrite ^/export\/([A-Za-z]+)\/([0-9]+)\/([A-Za-z]+)\/([A-Za-z0-9\_]+)\/$ /engine/handlers/export_handler.php?view=$1&guid=$2&type=$3&idname=$4;
}

location = /rewrite.php {
rewrite ^(.*)$ /install.php;
}

location / {
try_files $uri $uri/ /index.php?__elgg_uri=$uri&$query_string;
}

location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
include /etc/nginx/fastcgi_params;
fastcgi_pass 127.0.0.1:9000;
root /home/demyx.com/public_html;
fastcgi_index index.php;
fastcgi_connect_timeout 60;
fastcgi_send_timeout 180;
fastcgi_read_timeout 180;
fastcgi_buffer_size 256k;
fastcgi_buffers 4 256k;
fastcgi_busy_buffers_size 256k;
fastcgi_temp_file_write_size 256k;
fastcgi_intercept_errors on;
fastcgi_param SCRIPT_FILENAME /home/demyx.com/public_html$fastcgi_script_name;
}

include /etc/nginx/conf/staticfiles.conf;
#include /etc/nginx/conf/phpstatus.conf;
include /etc/nginx/conf/drop.conf;
#include /etc/nginx/conf/errorpage.conf;

}


Any help would be appreciated! By the way I am running on CentOS 6.7, PHP 5.6 and PHP-FPM. The data folder is located outside of the root directory and served via Elgg's proxy script but it's not finding it due to missing rules.

Viewing all articles
Browse latest Browse all 4759

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>