溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊(cè)×
其他方式登錄
點(diǎn)擊 登錄注冊(cè) 即表示同意《億速云用戶服務(wù)條款》

Yii2配置Nginx偽靜態(tài)的方法

發(fā)布時(shí)間:2020-08-07 12:29:09 來(lái)源:ITPUB博客 閱讀:189 作者:03ngnntds 欄目:建站服務(wù)器

這篇文章主要介紹了Yii2配置Nginx偽靜態(tài)的方法,結(jié)合實(shí)例形式分析了Yii2框架針對(duì)Nginx偽靜態(tài)的相關(guān)配置技巧,需要的朋友可以參考下

本文實(shí)例講述了Yii2配置Nginx偽靜態(tài)的方法。分享給大家供大家參考,具體如下:

主要檢查以下代碼:

location / { # Redirect everything that isn’t a real file to index.php try_files $uri uri//index.php?uri/ /index.php?uri//index.php?args;}

完整代碼:

server { charset utf-8; client_max_body_size 128M; listen 80; ## listen for ipv4 #listen [::]:80 default_server ipv6only=on; ## listen for ipv6 server_name mysite.local; root /path/to/basic/web; index index.php; access_log /path/to/basic/log/access.log; error_log /path/to/basic/log/error.log; location / { # Redirect everything that isn’t a real file to index.php try_files $uri uri//index.php?uri/ /index.php?uri//index.php?args; } # uncomment to avoid processing of calls to non-existing static files by Yii #location ~ .(js|css|png|jpg|gif|swf|ico|pdf|mov|fla|zip|rar)$ { # try_files KaTeX parse error: Expected 'EOF', got '#' at position 11: uri =404; #?} #error_page 4…{ include fastcgi_params; fastcgi_param SCRIPT_FILENAME documentroot/document_root/documentroot/fastcgi_script_name; fastcgi_pass 127.0.0.1:9000; #fastcgi_pass unix:/var/run/php5-fpm.sock; try_files $uri =404; } location ~ /.(ht|svn|git) { deny all; }}

更多關(guān)于Yii相關(guān)內(nèi)容感興趣的讀者可查看本站專題:《Yii框架入門及常用技巧總結(jié)》、《php優(yōu)秀開(kāi)發(fā)框架總結(jié)》、《smarty模板入門基礎(chǔ)教程》、《php面向?qū)ο蟪绦蛟O(shè)計(jì)入門教程》、《php字符串(string)用法總結(jié)》、《php+mysql數(shù)據(jù)庫(kù)操作入門教程》及《php常見(jiàn)數(shù)據(jù)庫(kù)操作技巧匯總》

希望本文所述對(duì)大家基于Yii框架的PHP程序設(shè)計(jì)有所幫助。

文章來(lái)源:搜索引擎大全http://www.iis7.com/b/ssyqdq/


向AI問(wèn)一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI