如何將wordpress安裝在子目錄中?nginx配置文件該怎樣寫?
問(wèn)題描述
我想在根目錄中安裝一個(gè)靜態(tài)網(wǎng)站,在子目錄中安裝wordpress(/blog/)應(yīng)該如何設(shè)置?
問(wèn)題解答
回答1:server { listen 80; server_name XXXXX.com; root/var/www/XXXXX.com; location / {index index.html index.htm; } location /blog {index index.html index.htm index.php;try_files $uri $uri/ /blog/index.php?$args; } location ~ .php$ {fastcgi_split_path_info ^(.+.php)(/.+)$;if (!-f $document_root$fastcgi_script_name) { return 404;}fastcgi_param PATH_INFO $fastcgi_path_info;fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;include fastcgi_params;fastcgi_index index.php;# fastcgi_pass 127.0.0.1:9000;fastcgi_pass unix:/var/run/php5-fpm.sock; }}
相關(guān)文章:
1. python的文件讀寫問(wèn)題?2. javascript - h5上的手機(jī)號(hào)默認(rèn)沒(méi)有識(shí)別3. mysql里的大表用mycat做水平拆分,是不是要先手動(dòng)分好,再配置mycat4. javascript - 圖片鏈接請(qǐng)求一直是pending狀態(tài),導(dǎo)致頁(yè)面崩潰,怎么解決?5. javascript - 關(guān)于圣杯布局的一點(diǎn)疑惑6. python - 獲取到的數(shù)據(jù)生成新的mysql表7. javascript - 請(qǐng)問(wèn) chrome 為什么會(huì)重復(fù)加載圖片資源?8. window下mysql中文亂碼怎么解決??9. javascript - jquery hide()方法無(wú)效10. 怎么用css截取字符?
