nginx部署项目

73 阅读1分钟

nginx安装过程略,项目打包文件放在根目录的html文件夹内,在nginx根目录的conf文件夹下的nginx.conf文件修改nginx配置。 server配置如下

server {
    #nginx启动的端口号↓
    listen       6666;
    server_name  xxx;
    #反向代理↓
    location /llm/userApi {
       #监听/llm/userApi开头路径,下面的rewrite意思是去掉请求中的/llm/userApi
       rewrite "^/llm/userApi/(.*)$" /$1 break;
       root   html;
       index  index.html index.htm;
       proxy_pass   http://xxx:13201;
    }
    location /llm/llmApi {
       rewrite "^/llm/llmApi/(.*)$" /$1 break;
       root   html;
       index  index.html index.htm;
       proxy_pass   http://xxx:13200;
    }
}