容器技术交流

 找回密码
 立即注册
查看: 4394|回复: 1

nginx伪静态设置

[复制链接]
发表于 2012-8-25 16:41:28 | 显示全部楼层 |阅读模式
请问下,我的伪静态该怎么设置呀。
这是maccms 出示的。规则。
规则如下
  •         rewrite ^/index.html$ /index.php$1;
  •         rewrite ^/allvod.html$ /allvod.php$1;
  •         rewrite ^/(.*)vod/(.+?)\.html$ $1/vod/index.php?$2.html;
  •         rewrite ^/(.*)vodlist/(.+?)\.html$ $1/vodlist/index.php?$2.html;
  •         rewrite ^/(.*)vodplay/(.+?)\.html$ $1/vodplay/index.php?$2.html;
  •         rewrite ^/(.*)vodtopic/(.+?)\.html$ $1/vodtopic/index.php?$2.html;
  •         rewrite ^/(.*)vodtopicindex/(.+?)\.html$ $1/vodtopicindex/index.php?$2.html;
  •         rewrite ^/(.*)artlist/(.+?)\.html$ $1/artlist/index.php?$2.html;
  •         rewrite ^/(.*)art/(.+?)\.html$ $1/art/index.php?$2.html;
  •         rewrite ^/(.*)arttopic/(.+?)\.html$ $1/arttopic/index.php?$2.html;
  •         rewrite ^/(.*)arttopicindex/(.+?)\.html$ $1/arttopicindex/index.php?$2.html;

使用方法,应该用ng的人都知道吧。

把代码复制,保存成 xxxx.conf

然后使用vps或者服务器的可以在你的主机的conf里 用 include xxxxx.conf   也就是包含下伪静态规则文件

如果用的是虚拟主机版的nginx 就找你的主机商给你添加规则就行,你把规则发给他。


做好以后,别忘了 service restart下你的nginx

===================================
请问下,我该怎么写
在LUMANAGERR后台找到了这个,是不是写在这里
/usr/local/nginx/conf/nginx.conf: Nginx的配置文件

发表于 2013-6-3 15:10:11 | 显示全部楼层
本帖最后由 huage 于 2013-6-3 15:10 编辑

直接在后台相关网站设置中Nginx扩展设置(server段)填写即可
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋|Archiver|URLOS ( 粤ICP备18087780号 )

GMT+8, 2025-7-2 18:28 , Processed in 0.040543 second(s), 18 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表