- 我是否修改網站可用/ mysite的文件,或者我應該使用這種類型的東西HTML/nginx.conf?
使用自定義配置(sites-available/your-conf)在使用nginx時是首選。 只需通過這些配置,nginx也可以用作負載平衡系統。
- 我需要在修改我的conf文件後重新啓動Nginx嗎? 是的,你可以。
下面是一個示例配置(這已經是適當的命名運行WordPress的代替。
此外,official documentation關於WordPress Mulltisite可以給你一個想法。
server {
listen 80;
root /var/www/wordpress;
index index.php index.html index.htm;
access_log /var/log/nginx/wordpress.access.log;
error_log /var/log/nginx/wordpress.error.log;
# Make site accessible from http://localhost/
# Add wordpress.local.com to your hosts.conf file if not an alive host
server_name wordpress.local.com;
location/{
try_files $uri $uri/ /index.php?q=$uri&$args;
}
error_page 404 /404.html;
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/www;
}
include fastcgi.conf;
}
可以分享你已經在使用的配置? 可能你需要改變nginx(或者php-fpm)的文件系統深度 – ilhnctn 2014-11-02 20:49:07