Joomla nginx 配置

joomla在nginx服務器上,設置 短連 時,需要修改nginx配置文件:nginx/conf/nginx.conf
添加以下內容:
如果網站爲根目錄時:

location / {
                try_files $uri $uri/ /index.php?q=$uri&$args;
        }

若果爲二級目錄時:

location /cn/ {
                try_files $uri $uri/ /cn/index.php?q=$uri&$args;
        }

或者用 rewrite:

location /cn/ {
         if (!-e $request_filename) {
                      rewrite ^/cn/(.*)$  /cn/index.php?q=$uri&$args;
                }
          }
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章