Jump to content
PHP論壇人

12.IPS論壇的Nginx偽靜態


Recommended Posts

------------------------------
IPS論壇的Nginx偽靜態
------------------------------

前面步驟,偽靜態那裡我輸入ips,所以在此修改ips的偽靜態內容
vi /usr/local/nginx/conf/rewrite/ips.conf


這個偽靜態規則是你論壇安裝在域名根目錄,就可以將以下內容複製貼上 (如果你論壇裝在子目錄則不能使用)

location / {
        try_files  $uri $uri/ /index.php;
  }

location ~^(/page/).*(.php)$ {
    try_files  $uri $uri/ /index.php;
}

location /api/ {
  if (!-e $request_filename){
    rewrite ^/api/(.*)$ /api/index.php;
  }
}


儲存並離開
:wq

 

重新啟動nginx
/etc/init.d/nginx restart

 

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...