Substitute
- domain_name1.com: Your domain name
- extra_domain_name.com: Extra domains if your also using extra domain mapping in wordpress
- file_root: Path to your wordpress install
Files
/etc/nginx/sites-available/domain_name1.com
# WordPress Multi Site Domain
server {
listen 80 ;
server_name .domain_name1.com .extra_domain_name.com;
root /file_root/wordpress;
index index.php index.html index.htm;
# Rewrite for multi site files
rewrite /files/(.+)$ /wp-includes/ms-files.php?file=$1 last;
# Rewrite for wordpress
if (!-e $request_filename) {
rewrite ^(.+)$ /index.php?q=$1 last;
}
location ~ \.php$ {
fastcgi_pass unix:/tmp/php-fastcgi.socket; # or port like 127.0.0.1:9000
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
Finish
sudo ln -s /etc/nginx/sites-available/domain_name.com /etc/nginx/sites-enabled/domain_name.com
sudo service nginx restart
2 Comments
Hey, that definately saved my day! Thx!
Thanks mate! Kind words always appreciated.