mirror of
https://github.com/mindoc-org/mindoc.git
synced 2026-02-27 17:03:57 +08:00
Updated 配合nginx让MinDoc运行在二级子目录 (markdown)
@@ -5,5 +5,35 @@
|
|||||||
之后,在nginx中配置路由规则,将属于MinDoc的路由重定向到MinDoc端口。配置如下:
|
之后,在nginx中配置路由规则,将属于MinDoc的路由重定向到MinDoc端口。配置如下:
|
||||||
|
|
||||||
```
|
```
|
||||||
|
server {
|
||||||
|
listen 443;
|
||||||
|
server_name www.iminho.me;
|
||||||
|
add_header X-Content-Type-Options nosniff;
|
||||||
|
|
||||||
|
charset utf-8;
|
||||||
|
error_page 500 502 503 504 /50x.html;
|
||||||
|
access_log /var/log/nginx/www.iminho.me/access.log main;
|
||||||
|
set $root_path '/var/www/www.iminho.me/mindoc';
|
||||||
|
root $root_path;
|
||||||
|
try_files $uri $uri/ @rewrite;
|
||||||
|
index index.php index.html;
|
||||||
|
location /50x.html {
|
||||||
|
root /var/www/html;
|
||||||
|
}
|
||||||
|
#此处是关键
|
||||||
|
location /wiki/ {
|
||||||
|
proxy_set_header X-Forwarded-For $remote_addr;
|
||||||
|
proxy_set_header Host $http_host;
|
||||||
|
proxy_set_header X-Forwarded-Proto $scheme;
|
||||||
|
#此处配置 MinDoc 程序的地址和端口号
|
||||||
|
proxy_pass http://127.0.0.1:8182/;
|
||||||
|
}
|
||||||
|
location / {
|
||||||
|
try_files $uri $uri/ /index.php?$query_string;
|
||||||
|
}
|
||||||
|
location ~* ^/(css|img|js|flv|swf|download)/(.+)$ {
|
||||||
|
root $root_path;
|
||||||
|
expires 30m;
|
||||||
|
}
|
||||||
|
}
|
||||||
```
|
```
|
||||||
Reference in New Issue
Block a user