linux下项目上线配置nginx+tomcat

nginx.conf

    server {
      listen       80;
      server_name  www.examples.com;
      client_max_body_size 300m; 
      #charset koi8-r;
      #access_log  logs/host.access.log  main;

        
      location / {
         index index.html;
            proxy_pass http://www.examples.com:8080;#这样写需配置hosts文件    指向本地tomcat
        }
    } 

tomcat_server.xml

<Host name="jiaozhou.taojietuan.com"  appBase="webapps"  unpackWARs="true" autoDeploy="true">
    <Context path="" docBase="/XXX/XXX/XXX"  reloadable="false">
        <ResourceLink name="XXX/XXX" global="XXX" type="javax.sql.DataSource"/>
    </Context>
</Host>

hosts:域名配置指向本地     linux系统hosts路径一般在/etc/hosts   

127.0.0.1 www.examples.com

原文地址:https://www.cnblogs.com/zimublog/p/9817305.html