如何將wordpress安裝在子目錄中?nginx配置文件該怎樣寫(xiě)?
問(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. boot2docker無(wú)法啟動(dòng)2. java - SSH框架中寫(xiě)分頁(yè)時(shí)service層中不能注入分頁(yè)類3. docker-compose中volumes的問(wèn)題4. 關(guān)docker hub上有些鏡像的tag被標(biāo)記““This image has vulnerabilities””5. docker安裝后出現(xiàn)Cannot connect to the Docker daemon.6. javascript - mock.js可以存儲(chǔ)數(shù)據(jù)嗎7. docker網(wǎng)絡(luò)端口映射,沒(méi)有方便點(diǎn)的操作方法么?8. javascript - vue生成一維碼?求助!!!!!急9. nignx - docker內(nèi)nginx 80端口被占用10. java - Spring事務(wù)回滾問(wèn)題

網(wǎng)公網(wǎng)安備