zoukankan      html  css  js  c++  java
  • Nginx代理多个80端口项目

    find / -name "nginx.conf"

    查找nginx位置

    kill掉现有进程

    ps -ef|grep nginx

    做配置

    server{
            listen       80;
            server_name  www.as-microwave.com;
            location / {
                  alias  /var/local/webapp/aishangzhihui/aishangzhihui/; #默认访问vue静态文件目录>(dist路径)
                  index  index.html; #默认访问文件
                  try_files $uri $uri/ /index.html; #目录不存在则执行index.html
              }
             error_page   500 502 503 504  /50x.html;
            location = /50x.html {
                root   html;
            }
        }
       server {
          listen       80;
          server_name  www.jinxiuhangcheng.com;
    
       location / {
          proxy_set_header X-Real-IP $remote_addr;
          proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
          proxy_set_header Host $http_host;
          proxy_redirect off;
          proxy_pass http://127.0.0.1:8082;
         }
         access_log logs/data_access.log;
       }

    重启

    /usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
  • 相关阅读:
    反射
    Ajax
    JSP(二)
    JSP
    Servlet(三)
    Servlet(二)
    Servlet
    idea的Tomcat的配置
    使用Idea创建Maven构造的Web工程
    Maven的下载、安装与环境配置
  • 原文地址:https://www.cnblogs.com/zzuuoo666/p/14063007.html
Copyright © 2011-2022 走看看