常规 nginx 代理apache
2024-10-18 02:13:58
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 $scheme://www.xx.com$request_uri; }
############################## xu add ########## #if (!-e $request_filename) {
#rewrite ^(.*)$ /index.php?s=/$ 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 *:>
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;
}
}
最新文章
- mac osx 安装redis扩展
- git管理工具的使用教程
- 【iOS】Objective-C简约而不简单的单例模式
- linux直接启动到字符界面或从字符界面启动到图形化界面
- 3-08. 栈模拟队列(25)(ZJU_PAT 模拟)
- GZIP压缩、解压缩工具类
- ThinkPHP项目总结
- Python C++扩展
- 【视频编解码&#183;学习笔记】2. H.264简介
- 外观模式 门面模式 Facade 结构型 设计模式(十三)
- idea springboot jrebel hotreloaded
- python 字符串 转 bit, bitarray 异或加密
- MySQL优化:使用show status查看MySQL服务器状态信息
- NOI2019 SX 模拟赛 no.5
- Navicat使用ssh连接数据库
- 笔记:Python 默认参数必须指向不变对象
- 【洛谷P1522】牛的旅行
- c++并发编程之互斥锁(mutex)的使用方法
- eclipse常用插件介绍
- Vim的分屏功能
热门文章
- AspNetCoreapi 使用 Docker + Centos 7部署
- 【1】Asp.Net Core2.2从环境配置到应用建立
- [转]Windows10中Virtualbox没办法选择和安装64位的Linux系统
- jQuery(九)、ajax对象操作
- es6之字符串添加的东西
- 关于javascript异步
- 碰到了通过Movie显示gif图片,有部分图片的duration为0导致gif只显示第一帧
- iOS:我的学习路径
- <;%@ Register TagPrefix=";uc1"; TagName=";user"; Src=";../Control/user.ascx"; %>;什么意思?
- python中json文件处理涉及的四个函数json.dumps()和json.loads()、json.dump()和json.load()的区分