美文网首页
nginx 配置

nginx 配置

作者: 阿杰_96c5 | 来源:发表于2022-04-14 09:56 被阅读0次

    nginx 多个 root页面配置

     server {
            listen       80;
            server_name  192.168.5.205;
    
            #charset koi8-r;
    
            #access_log  logs/host.access.log  main;
            
           location / {
               root   /home/alidata/java_test/comvee_dz/web-front/;
               index  login/login.html;
           }
           
           location /admin {
                alias  /home/alidata/java_test/comvee_dz/web-admin/;
                index  login.html;
            }
    }
    

    反向代理

        server {
            listen       80;
            server_name  192.168.1.125;
            
            location / {
                root   D:/IdeaProjects/nanan/comvee_nanan/trunk/web-front/;
                index  login/login.html;
            }
            
            location /hxyy/ {
                 proxy_pass      http://localhost:8080/hxyy/;
                 proxy_set_header Host      $host:$server_port;
                 proxy_set_header X-Real-IP $remote_addr;
                 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            }
        }
    

    相关文章

      网友评论

          本文标题:nginx 配置

          本文链接:https://www.haomeiwen.com/subject/eyvgsrtx.html