3 Star 0 Fork 0

crazycode/小鸟课堂

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
nginx.conf 7.00 KB
一键复制 编辑 原始数据 按行查看 历史
crazycode 提交于 2023-06-17 13:43 . add nginx.conf.
#user nobody;
worker_processes 1;
#127.0.0.1 www.xiaoniao.cn file.xiaoniao.cn
#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
#pid logs/nginx.pid;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
#log_format main '$remote_addr - $remote_user [$time_local] "$request" '
# '$status $body_bytes_sent "$http_referer" '
# '"$http_user_agent" "$http_x_forwarded_for"';
#access_log logs/access.log main;
#设置Nginx文件上传大小限制
client_max_body_size 100m;
sendfile on;
#tcp_nopush on;
#keepalive_timeout 0;
keepalive_timeout 65;
add_header Access-Control-Allow-Origin *;
#gzip on;
upstream fileserver{
#nginx反向代理的目标服务器
server 192.168.101.65:9000 weight=10;#weight 表示使用权重负载均衡策略
}
#网关
upstream getwayserver{
#nginx反向代理的目标服务器
server localhost:63010 weight=10;#weight 表示使用权重负载均衡策略
}
#后台课程管理服务
upstream uidevserver{
server 127.0.0.1:8601 weight=10;
}
server {
#后台课程管理服务
listen 80;
server_name teacher.xiaoniao.cn;
#charset koi8-r;
ssi on;
ssi_silent_errors on;
#access_log logs/host.access.log main;
location / {
proxy_pass http://uidevserver;
}
location /api/ {
proxy_pass http://getwayserver/;
}
}
server {
#文件服务
listen 80;
server_name file.xiaoniao.cn;
#charset koi8-r;
ssi on;
ssi_silent_errors on;
#access_log logs/host.access.log main;
location /video {
#反向代理的目标地址
proxy_pass http://fileserver;
}
location /mediafiles {
proxy_pass http://fileserver;
}
}
server {
#微信扫码服务
listen 8160;
server_name localhost;
#charset koi8-r;
ssi on;
ssi_silent_errors on;
#access_log logs/host.access.log main;
location / {
#反向代理的目标地址
proxy_pass http://getwayserver/auth/wxLogin/;
}
}
server {
#我的课表服务
listen 80;
server_name ucenter.xiaoniao.cn;
#charset koi8-r;
ssi on;
ssi_silent_errors on;
#access_log logs/host.access.log main;
location / {
alias G:/xuechengzaixian/code_xc/xiaoniao-front/ucenter/;
index index.html index.htm;
}
location /include {
proxy_pass http://127.0.0.1;
}
location /img/ {
proxy_pass http://127.0.0.1/static/img/;
}
location /api/ {
proxy_pass http://getwayserver/;
}
}
#基础服务
server {
listen 80;
server_name www.xiaoniao.cn www.crazycode.cn localhost;
#rewrite ^(.*) https://$server_name$1 permanent;
#charset koi8-r;
ssi on;
ssi_silent_errors on;
#access_log logs/host.access.log main;
#api 以api开头的都进入网关
location /api/{
proxy_pass http://getwayserver/;
}
#课程预览中播放
location /open/content/ {
proxy_pass http://getwayserver/content/;
}
#课程预览中播放,切换视频
location /open/media/ {
proxy_pass http://getwayserver/media/open/;
}
#访问课程预览
location /course/{
proxy_pass http://fileserver/mediafiles/course/;
}
location / {
alias G:/xuechengzaixian/code_xc/xiaoniao-front/;
index index.html index.htm;
}
#静态资源
location /static/img/ {
alias G:/xuechengzaixian/code_xc/xiaoniao-front/img/;
}
location /static/css/ {
alias G:/xuechengzaixian/code_xc/xiaoniao-front/css/;
}
location /static/js/ {
alias G:/xuechengzaixian/code_xc/xiaoniao-front/js/;
}
location /static/plugins/ {
alias G:/xuechengzaixian/code_xc/xiaoniao-front/plugins/;
add_header Access-Control-Allow-Origin http://ucenter.xiaoniao.cn;
add_header Access-Control-Allow-Credentials true;
add_header Access-Control-Allow-Methods GET;
}
location /plugins/ {
alias G:/xuechengzaixian/code_xc/xiaoniao-front/plugins/;
}
location /include/ {
alias G:/xuechengzaixian/code_xc/xiaoniao-front/include/;
}
location /course/preview/learning.html {
alias G:/xuechengzaixian/code_xc/xiaoniao-front/course/learning.html;
}
location /course/search.html {
root G:/xuechengzaixian/code_xc/xiaoniao-front;
}
location /course/learning.html {
root G:/xuechengzaixian/code_xc/xiaoniao-front;
}
#error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
# proxy the PHP scripts to Apache listening on 127.0.0.1:80
#
#location ~ \.php$ {
# proxy_pass http://127.0.0.1;
#}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
#location ~ \.php$ {
# root html;
# fastcgi_pass 127.0.0.1:9000;
# fastcgi_index index.php;
# fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
# include fastcgi_params;
#}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
#location ~ /\.ht {
# deny all;
#}
}
# another virtual host using mix of IP-, name-, and port-based configuration
#
#server {
# listen 8000;
# listen somename:8080;
# server_name somename alias another.alias;
# location / {
# root html;
# index index.html index.htm;
# }
#}
# HTTPS server
#
#server {
# listen 443 ssl;
# server_name localhost;
# ssl_certificate cert.pem;
# ssl_certificate_key cert.key;
# ssl_session_cache shared:SSL:1m;
# ssl_session_timeout 5m;
# ssl_ciphers HIGH:!aNULL:!MD5;
# ssl_prefer_server_ciphers on;
# location / {
# root html;
# index index.html index.htm;
# }
#}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/Yang_Pengasd/bird-classroom.git
git@gitee.com:Yang_Pengasd/bird-classroom.git
Yang_Pengasd
bird-classroom
小鸟课堂
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385