zoukankan      html  css  js  c++  java
  • 常规 nginx 代理apache

    nginx:

    server {
      server_name www.xx.com xx.com;
      access_log /data/wwwlogs/www.xx.com_nginx.log combined;
      index index.html index.htm index.php;
      root /home/f/data/wwwroot/www.xx.com/xx/public;
      if ($host != www.xx.com) {  return 301 $scheme://www.xx.com$request_uri;  }
      ############################## xu add ##########
    
       #if (!-e $request_filename) {
       #rewrite  ^(.*)$  /index.php?s=/$1  last;
       #break;
       #}
    
      ############################### end #################################
      location / {
        try_files $uri @apache;
      }
      location @apache {
        proxy_pass http://127.0.0.1:88;
        include proxy.conf;
        proxy_hide_header Upgrade;
      }
      location ~ .*.(php|php5|cgi|pl)?$ {
        proxy_pass http://127.0.0.1:88;
        include proxy.conf;
        proxy_hide_header Upgrade;
      }
      location ~ .*.(gif|jpg|jpeg|png|bmp|swf|flv|mp4|ico)$ {
        expires 30d;
        access_log off;
      }
      location ~ .*.(js|css)?$ {
        expires 7d;
        access_log off;
      }
      location ~ /.ht {
        deny all;
      }
    }

    apache:

    <VirtualHost *:88>
      ServerAdmin admin@example.com
      DocumentRoot "/home/f/data/wwwroot/www.xx.com/xx/public"
      ServerName www.xx.com
      ServerAlias xx.com
    
      ErrorLog "/data/wwwlogs/www.xx.com_error_apache.log"
      CustomLog "/data/wwwlogs/www.xx.com_apache.log" common
    <Directory "/home/f/data/wwwroot/www.xx.com/xx/public">
      SetOutputFilter DEFLATE
      Options FollowSymLinks ExecCGI
      Require all granted
      AllowOverride All
      Order allow,deny
      Allow from all
      DirectoryIndex index.html index.php
    </Directory>
    </VirtualHost>

    简单配置 nginx 转发 Tomcat :

    server {
      listen 80;
      server_name shxt.yadanmall.com;
      access_log /data/wwwlogs/shxt.yadanmall.com_nginx.log combined;
      index index.html index.htm index.php;
      root /home/f/data/wwwroot/shxt;
      
      
      location / {  
        proxy_pass http://localhost:8080;
      }
    }
    

      

  • 相关阅读:
    Git 进阶学习
    My SQL 学习打卡 60天搞定mysql
    设计模式 学习笔记
    docker 从入门到精通
    java 异步线程下的顺序控制
    Maven 工程 如何添加 oracle 驱动 问题
    Hive 2.1.1 学习笔记
    Linux 下 MySQL-5.6.16 安装
    hadoop2.x HDFS HA linux环境搭建
    [LC] 1146. Snapshot Array
  • 原文地址:https://www.cnblogs.com/q1104460935/p/10265217.html
Copyright © 2011-2022 走看看