加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
test.conf 1.87 KB
一键复制 编辑 原始数据 按行查看 历史
bode135 提交于 2021-05-08 04:40 . username
# 首页: uni前端, /mds: markdown文档
server {
listen 80;
charset utf-8;
server_name 127.0.0.1;
server_name 47.97.159.133;
# rewrite ^/(.*) http://www.baidu.com/ permanent; # 重定向
# uni-app's client
location / {
root /etc/nginx/sites-available; # 注意此处root和后面alias的区别
index index.html index.htm;
}
# markdown documents
location /mds {
alias /etc/nginx/sites-available/mds/test_md_page.github.io;
index index.html index.htm;
# proxy_pass http://localhost:7080; # 代理本地端口
}
# websocket http://www.bodexiong.vip/ws/chat
location /chat {
proxy_pass http://localhost:8001;
proxy_set_header Host $host;
}
location ~ /ws/chat {
proxy_pass http://localhost:8001;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $server_name;
}
}
# uni后端
server {
charset utf-8;
listen 3389;
server_name 47.97.159.133; # 改成你的 IP
location /static {
alias /home/sites/uniapps/hello_uni/static;
}
location /media {
alias /home/sites/uniapps/hello_uni/media;
}
location / {
proxy_set_header Host $host;
proxy_pass http://127.0.0.1:8000;
}
}
# my blog
server {
# listen 80;
listen 443;
charset utf-8;
server_name 127.0.0.1;
server_name 47.97.159.133;
location /static {
alias /home/sites/bodexiong.vip/django_blog_tutorial/collected_static;
}
location /media {
alias /home/sites/bodexiong.vip/django_blog_tutorial/media;
}
location / {
proxy_set_header Host $host;
proxy_pass http://127.0.0.1:8080;
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化