跳至內容
阿里BaBa電腦筆記
使用者工具
登入
網站工具
工具
顯示頁面
舊版
反向連結
最近更新
多媒體管理器
網站地圖
登入
最近更新
多媒體管理器
網站地圖
足跡:
linux:web:nginx_alias
本頁是唯讀的,您可以看到原始碼,但不能更動它。您如果覺得它不應被鎖上,請詢問管理員。
======配置說明====== 假若在網址上打上 http://www.examplepppp.com/A1/ 連結到的網頁實記錄徑為 /var/www/html/happy/index.php,要實現這樣結果就必須搭配 Nginx的Alias及rewrite或Nginx 內建變數 "$valid_fastcgi_script_name"。以下展示範例<code> ~略~ server { listen 80; server_name www.examplepppp.com; root /var/www/html/; index index.html index.php; location /A1/ { alias /var/www/html/happy/; index index.html index.php; } location ~ /A1/.*\.php$ { if ($fastcgi_script_name ~ /A1/(.*\.php)$) { set $valid_fastcgi_script_name $1; } fastcgi_pass 127.0.0.1:10004; fastcgi_param SCRIPT_FILENAME /var/www/html/A1/$valid_fastcgi_script_name; } }</code> ======參考資料====== - [[http://code.google.com/p/emillers-guide-to-nginx-module-chn/wiki/NginxModuleDevGuide_CHN|Emiller的Nginx模塊開發指南中文版]] - [[http://wiki.nginx.org/NginxChsFcgiExample|虛擬目錄也支持php]]
linux/web/nginx_alias.txt
· 上一次變更: 2013/08/09 00:46 (外部編輯)
頁面工具
顯示頁面
舊版
反向連結
回到頁頂