Hi,
I'm trying to set up my web server (nginx) as a catchall virtual host, as per an example that can be seen here:
http://wiki.nginx.org/NginxVirtualHostExample (It's the Wildcard Subdomains in a Parent Folder example).
Now, here's my issue. I use Wordpress on the coburndomain.org domain. I have pretty URLs enabled, that make my Wordpress articles look like this:
somesite_DOT_com/index.php/2010/09/woo-hoo-this-works-2/
At the moment, nginx is reporting 500 Errors, saying that index.php is not a directory. What I want to do is make a rewrite rule that allows me to use the above URL example with nginx.
I followed this tutorial to do so:
http://www.romej.com/archives/515/ng...ordpress-redux , but I'm not sure how to apply it to my setup. Here's my configuration files from Debian Squeeze with Nginx onboard:
/etc/nginx/nginx.conf
Code:
user www-data;
worker_processes 1;
error_log /private/www/logs/error.log;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
# multi_accept on;
}
http {
include /etc/nginx/mime.types;
access_log /private/www/logs/access.log;
log_format main '$remote_addr $remote_user [$time_local] "$request" ' '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for"';
sendfile on;
#tcp_nopush on;
#keepalive_timeout 0;
keepalive_timeout 65;
tcp_nodelay on;
gzip on;
gzip_disable "MSIE [1-6]\.(?!.*SV1)";
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
}
/etc/nginx/sites-enabled/vhosts
Code:
server {
# Replace this port with the right one for your requirements
listen 80; #could also be 1.2.3.4:80
# Multiple hostnames separated by spaces. Replace these as well.
server_name iceprism.coburndomain.org ;
root /private/www/vhosts/$host;
# error_page 404 ;
access_log /private/www/logs/access.log;
index index.php index.html index.htm;
# serve static files directly
location ~* ^.+\.(jpg|jpeg|gif|css|png|js|ico|html)$ {
access_log off;
expires 30d;
}
# Dunno what this does...
# location / {
# try_files $uri $uri/ /index.php$uri =404;
#}
# This didn't work either >_>
# if (!-e $request_filename) {
# rewrite ^/(.*)$ /index.php/$1 last;
# }
location ~ .php$ {
# By all means use a different server for the fcgi processes if you need to
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param REQUEST_URI $request_uri;
fastcgi_param DOCUMENT_URI $document_uri;
fastcgi_param DOCUMENT_ROOT $document_root;
fastcgi_param REMOTE_ADDR $remote_addr;
fastcgi_param REMOTE_PORT $remote_port;
fastcgi_param SERVER_ADDR $server_addr;
fastcgi_param SERVER_PORT $server_port;
fastcgi_param SERVER_NAME $server_name;
fastcgi_param QUERY_STRING $query_string;
fastcgi_param REQUEST_METHOD $request_method;
fastcgi_param CONTENT_TYPE $content_type;
fastcgi_param CONTENT_LENGTH $content_length;
fastcgi_intercept_errors on;
}
location ~ /\.ht {
deny all;
}
}
Could anyone shine some light onto this? Nginx is by far the best webserver for my needs, and I hate to have to turn off SEO-friendly Wordpress URLs.
Cheers,
Coburn64