Hello,
i am using this file hosting script with Nginx without any problems,
my opinion is that Apache should retire years ago, it fills up your ram and kill the servers processor if you have any good traffic to your site,
that is why im using Nginx, Apache its loading new thread (2-3mb ram) per visitor, that it why your ram fills up and why your processor is on high load
with Nginx on the other hand it's only use one thread to handle all request and i can't barely see any server load or memory use at all with tons of visitor, Netflix and Facebook and many more sites its using Nginx, that is why i love Nginx.
But Here's is the rewrite:
server {
listen 80; # your server's public IP address
server_name site.com; # your domain name
root /usr/share/nginx/www/public_html/site.com/public/; # absolute path to your installation
index index.php index.html index.htm;
client_max_body_size 5G;
location / {
try_files $uri $uri/ /index.php?page_request=$uri;
if ($uri ~ "^(.+)~s$"){
set $rule_0 1$rule_0;
}
if ($rule_0 = "1"){
rewrite ^/(.*) /stats.php?u=$1 last;
}
if ($uri ~ "^(.+)~d$"){
set $rule_0 1$rule_0;
}
if ($rule_0 = "1"){
rewrite ^/(.*) /delete_file.php?u=$1 last;
}
if ($uri ~ "^(.+)~i$"){
set $rule_0 1$rule_0;
}
if ($rule_0 = "1"){
rewrite ^/(.*) /share_file.php?u=$1 last;
}
if ($uri ~ "^(.+)~f$"){
set $rule_0 1$rule_0;
}
if ($rule_0 = "1"){
rewrite ^/(.*) /view_folder.php?f=$1 last;
}
if (!-f $request_filename){
set $rule_0 1$rule_0;
}
if (!-d $request_filename){
set $rule_0 2$rule_0;
}
if ($rule_0 = "21"){
rewrite ^/(.*) /file_download.php?u=$1 last;
}
}
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/tmp/php5-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
}
}
Hope it helps!
i am using this file hosting script with Nginx without any problems,
my opinion is that Apache should retire years ago, it fills up your ram and kill the servers processor if you have any good traffic to your site,
that is why im using Nginx, Apache its loading new thread (2-3mb ram) per visitor, that it why your ram fills up and why your processor is on high load
with Nginx on the other hand it's only use one thread to handle all request and i can't barely see any server load or memory use at all with tons of visitor, Netflix and Facebook and many more sites its using Nginx, that is why i love Nginx.
But Here's is the rewrite:
server {
listen 80; # your server's public IP address
server_name site.com; # your domain name
root /usr/share/nginx/www/public_html/site.com/public/; # absolute path to your installation
index index.php index.html index.htm;
client_max_body_size 5G;
location / {
try_files $uri $uri/ /index.php?page_request=$uri;
if ($uri ~ "^(.+)~s$"){
set $rule_0 1$rule_0;
}
if ($rule_0 = "1"){
rewrite ^/(.*) /stats.php?u=$1 last;
}
if ($uri ~ "^(.+)~d$"){
set $rule_0 1$rule_0;
}
if ($rule_0 = "1"){
rewrite ^/(.*) /delete_file.php?u=$1 last;
}
if ($uri ~ "^(.+)~i$"){
set $rule_0 1$rule_0;
}
if ($rule_0 = "1"){
rewrite ^/(.*) /share_file.php?u=$1 last;
}
if ($uri ~ "^(.+)~f$"){
set $rule_0 1$rule_0;
}
if ($rule_0 = "1"){
rewrite ^/(.*) /view_folder.php?f=$1 last;
}
if (!-f $request_filename){
set $rule_0 1$rule_0;
}
if (!-d $request_filename){
set $rule_0 2$rule_0;
}
if ($rule_0 = "21"){
rewrite ^/(.*) /file_download.php?u=$1 last;
}
}
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/tmp/php5-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
}
}
Hope it helps!