I've setup an nginx file server recently. Went to add it and ran a test in the file server tab. It's asking for .htaccess/mod_rewrite support. I've added the rules to the nginx.config which should be alright, but it still errors out there and won't take uploads.
I'm not too experienced with nginx myself, so I figured I'd look for tips here. Also, this was a DA control panel server. Possibly help some others out with the new rules.
Aside form this, everything else seems to load alright and it connects to the database just fine.
Code:
user nginx;
# The number of worker processes is changed automatically by CustomBuild, according to the number of CPU cores, if it's set to "1"
worker_processes 20;
pid /var/run/nginx.pid;
#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
events {
include /etc/nginx/nginx-events.conf;
}
http {
include /etc/nginx/mime.types;
# For user configurations not maintained by DirectAdmin. Empty by default.
include /etc/nginx/nginx-includes.conf;
# Supplemental configuration
include /etc/nginx/nginx-defaults.conf;
include /etc/nginx/nginx-gzip.conf;
include /etc/nginx/directadmin-ips.conf;
include /etc/nginx/directadmin-settings.conf;
include /etc/nginx/nginx-vhosts.conf;
include /etc/nginx/directadmin-vhosts.conf;
server {
listen 80; ## listen for ipv4; this line is default and implied
root /usr/share/nginx/www;
index index.php;
client_max_body_size 5G;
# Make site accessible from http://localhost/
server_name localhost;
# pass the PHP scripts to FastCGI server listening
location ~ \.php$ {
# With php5-fpm:
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
location / {
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 ^/(.*) /index.php?_page_url=$1 last;
}
}
}
}
Aside form this, everything else seems to load alright and it connects to the database just fine.