用独立二级域名结合gitbook后端服务
server {
server_name homs.coder4.com;
location / {
proxy_pass http://localhost:4000;
proxy_set_header Host $host;
proxy_buffering off;
}
}
server {
server_name homs.coder4.com;
location / {
proxy_pass http://localhost:4000;
proxy_set_header Host $host;
proxy_buffering off;
}
}
server { server_name homs.coder4.com; location / { proxy_pass http://localhost:4000; proxy_set_header Host $host; proxy_buffering off; } }
路径转发,可以不用启动gitbook serve服务端,直接定向到文件夹即可
location /homs_online {
alias /home/coder4/code/hands-on-microservices/_book;
}
location /homs_online {
alias /home/coder4/code/hands-on-microservices/_book;
}
location /homs_online { alias /home/coder4/code/hands-on-microservices/_book; }
注意_book是需要gitbook build的