九溪

溪水润知林,滴露启慧心

用户工具

站点工具


wiki:linux:nginx-php-dokuwiki

示例:Dokuwiki 网站在 Nginx & PHP7.0 环境下的配置

Nginx 配置文件: /etc/nginx/sites-available/xxx.com

功能:

  • 开启php功能
  • 开启rewrite功能
  • www.example.com 自动重定向到 example.com
server {
  server_name example.com;
  listen 80;
  autoindex off;
  client_max_body_size 15M;
  client_body_buffer_size 128k;
  index index.html index.htm index.php doku.php;
  #access_log  /var/log/nginx/example.com/access.log;
  #error_log  /var/log/nginx/example.com/error.log;
  root /var/www/example.com;

  location / {
    try_files $uri $uri/ @dokuwiki;
    if (!-f $request_filename)
    {
        rewrite ^(/)(.*)?(.*)  $1doku.php?id=$2&$3 last;
        rewrite ^(/)$ $1doku.php last;
    }
  }

  location @dokuwiki {
    rewrite ^(/)_media/(.*) $1lib/exe/fetch.php?media=$2 last;
    rewrite ^(/)_detail/(.*) $1lib/exe/detail.php?media=$2 last;
    rewrite ^(/)_export/([^/]+)/(.*) $1doku.php?do=export_$2&id=$3 last;
  }

  location ~ ^/lib.*\.(gif|png|ico|jpg)$ {
    expires 30d;
  }

  location = /robots.txt  { access_log off; log_not_found off; }
  location = /favicon.ico { access_log off; log_not_found off; }
  location ~ /\.          { access_log off; log_not_found off; deny all; }
  location ~ ~$           { access_log off; log_not_found off; deny all; }

  location ~ \.php$ {
          include snippets/fastcgi-php.conf;
          fastcgi_pass unix:/run/php/php7.0-fpm.sock;
  }

  location ~ /(data|conf|bin|inc)/ {
    deny all;
  }

  location ~ /\.ht {
    deny  all;
  }
}

server {
    listen       80;
    server_name  www.example.com;
    return       301 http://example.com$request_uri;
}

评论

Slot838, 2025/06/20 00:41

Just desire to say your article is as astonishing. The clearness for your post is simply nice and i could assume you are a professional on this subject. Fine along with your permission allow me to grab your RSS feed to keep updated with imminent post. Thank you one million and please keep up the gratifying work.

Slot838, 2025/06/20 00:41

Just desire to say your article is as astonishing. The clearness for your post is simply nice and i could assume you are a professional on this subject. Fine along with your permission allow me to grab your RSS feed to keep updated with imminent post. Thank you one million and please keep up the gratifying work.

Adult websites, 2025/06/06 01:41

It’s explicitly sexual and while watching, most men engage in self-sexing, which around 25 percent of women consider appalling and the sex addiction industry calls pathological.

Adult websites, 2025/06/06 01:40

It’s explicitly sexual and while watching, most men engage in self-sexing, which around 25 percent of women consider appallng and the sex addiction industry calls pathological.

Porn Sites, 2025/06/05 18:54

It’s explicitly sexual and while watching, most men engage in self-sexing, which around 25 percent of womjen consider appalling aand tthe sex addiction industry calls pathological.

Porn Sites, 2025/06/05 18:54

It’s explicitly sexual and while watching, most men engage in self-sexing, which aroun 25 percent of women consider appalling and thee sex adxdiction industry calls pathological.

HD Adult Streaming, 2025/06/05 18:34

It’s explicitly sexual and while watching, most men engage in self-sexing, which around 25 percent of women consider appalling and thee sex addiction industty calls pathological.

HD Adult Streaming, 2025/06/05 18:34

It’s explicitly sexual and while watching, most men engage in self-sexing, which around 25 percent of wmen consider appalling and the sex addiction industry calps pathological.

Erotic Websites, 2025/06/04 01:56

This means that even iif someone tries to bhpass your parental controls, they won’t be able to accesws inappropriate websites.

Erotic Websites, 2025/06/04 01:56

This means that even if someone tries to bypass your parental controls, they won’t be able too access inappropriate websites.

Adult Websites, 2025/06/03 11:39

This means that even if someone tries to bypass your parental controls, they won’t be able to access inappropriate websites.

Adult Websites, 2025/06/03 11:39

This means that evcen if sommeone tries to bypass your parental controls, they won’t be able to access inappropriate websites.

Hot Ebony Girls, 2025/06/02 13:34

Our sexy black performers are second to none at what they do and what they do is fuck on camera in the sexiest XXX action available.

Hot Ebony Girls, 2025/06/02 13:34

Our sexy black performers are second to none at what the do and what they do is fuck on camefa inn the sexiest XXX actionn available.

https://jabletv.ru, 2025/06/02 07:05

Great post. I was checking constantly this weblog and I am inspired! Extremely helpful info specifically the remaining section :) I deal with such info much. I used to be looking for this certain information for a very long time. Thanks and good luck.

https://jabletv.ru, 2025/06/02 07:05

Great post. I was checking constantly this weblog and I am inspired! Extremely helpful info specifically the remaining section :) I deal with such info much. I used to be looking for this certain information for a very long time. Thanks and good luck.

Porn Platforms, 2025/06/01 03:11

This means that even iff someone tries to bypass your parental controls, they won’t be ale to access inappropriate websites.

Porn Platforms, 2025/06/01 03:11

This means that even if smeone tries to bypass your parental controls, they won’t be able to access inappropriate websites.

Porn Platforms, 2025/05/31 02:59

This means that even if someone tries to bypass your parental controls, they won’t be able to access inappropriate websites.

Porn Platforms, 2025/05/31 02:59

This means that even if someone tries to bypass yor parental controls, they won’t be able to access inappropriate websites.

Mature Content, 2025/05/30 12:26

Thumbs uup for nonfat whores who taske care of themselves.

Mature Content, 2025/05/30 12:26

Thmbs up for nnonfat whores whoo take care of themselves.

http://mex-Pharmacy.com, 2025/05/27 11:07

This means that even if someone tries to bypass your parental controls, they won’t be ablee to access inappropriate websites.

http://mex-Pharmacy.com, 2025/05/27 11:07

This means that even iif someone tries to bypass your parental controls, they won’t be able to access inappropriate websites.

Adult Entertainment, 2025/05/25 12:11

It’s explicitly sexual and while watching, most mmen engage in self-sexing, which around 25 percent of women consider appalling and the sex addiction industry calls pathological.

Adult Entertainment, 2025/05/25 12:11

It’s explicitly sexual and while watching, most men engage in self-sexing, which around 25 percent of women consider appalling and the sex addiction industry calls pathological.

black vr porn, 2025/04/13 16:01

I every time used to study post in news papers but now as I am a user of internet so from now I am using net for articles or reviews, thanks to web.

black vr porn, 2025/04/13 16:01

I every time used to study post in news papers but now as I am a user of internet so from now I am using net for articles or reviews, thanks to web.

请输入您的评论. 可以使用维基语法:
 
wiki/linux/nginx-php-dokuwiki.txt · 最后更改: 2023/01/03 15:25 由 127.0.0.1