0 Star 0 Fork 0

浪子花梦 / 技术文章收录

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
nginx反向代理项目.md 1.38 KB
一键复制 编辑 原始数据 按行查看 历史
浪子花梦 提交于 2023-04-09 09:52 . add nginx反向代理项目.md.
server {
    listen 80;
    server_name ×××.×××.×××.com;

    location / {
        try_files $uri $uri/ /index.html;
        alias /usr/share/nginx/html/demo/sx-ui/;
        index index.html index.htm;
    }

    location /admin {
        try_files $uri $uri/ /admin/index.html;
        alias /usr/share/nginx/html/demo/sx-admin-ui/;
        index index.html index.htm;
    }

    location /api/admin/ {
        proxy_pass http://172.17.0.1:11117/;
        proxy_redirect off;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forward-For $proxy_add_x_forwarded_for;
    }

    location /api/www/ {
        client_max_body_size 100m;
        proxy_pass http://172.17.0.1:11116/;
        proxy_redirect off;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forward-For $proxy_add_x_forwarded_for;
   }
}

nginx 同server_name下配置两个vue项目

server {
    listen 80;
    server_name ×××.×××.×××.com;

    location / {
        root /project/bydps/admin;
        index index.html index.htm;
        try_files $uri $uri/ /index.html;
    }

    location /pda {
        alias /project/bydps/pda;
        index index.html index.htm;
        try_files $uri $uri/ /pda/index.html;
    }
}
1
https://gitee.com/ithuameng/blog.git
git@gitee.com:ithuameng/blog.git
ithuameng
blog
技术文章收录
master

搜索帮助