1.4 测试CMS一键发布接口
1.4.1 配置虚拟主机
在nginx配置课程详情页面的虚拟主机,实现访问:www.xuecheng.com/course/detail/.....html。
#静态资源服务
upstream static_server_pool{
server 127.0.0.1:91 weight
=10;
}
server {
listen 80;
server_name www.xuecheng
.com;
ssi on;
ssi_silent_errors on;
#课程预览
location /course/detail/ {
proxy_pass http://static_server_pool;
}
}
#学成网静态资源
server {
listen 91;
server_name localhost;
#公司信息
location /static/company/ {
alias F:/develop/xuecheng/static/company/;
}
...
cms会将课程预览页面发布到服务器的F:/develop/xuecheng/static/course/detail/下,通过www.xuecheng.com/course/detail/