- 浏览: 293672 次
-
文章分类
- 全部博客 (276)
- burp+hydra暴力破解 (1)
- kali linux工具集 (6)
- kali (59)
- linux (54)
- password (14)
- web (63)
- 渗透测试 (50)
- windows (40)
- metasploit (9)
- 信息收集 (32)
- burp suit (4)
- 安全审计 (9)
- https://github.com/secretsquirrel/the-backdoor-factory (0)
- nmap (4)
- arachni (2)
- 工具 (5)
- sql (3)
- 网络 (2)
- 后渗透测试 (10)
- 内网 (5)
- 无线 (2)
- C (3)
- bios (1)
- RoR (12)
- mongodb (1)
- linxu (1)
- gdb (1)
- linux,虚拟化 (1)
- python (4)
最新评论
based on our case, we need to handle two different url request:
example/0.5/xxx ==> 192.168.1.100:8080/xxx
example/0.7/xxx ==> 192.168.1.101:8080/xxx
Here is the configuration:
root@p1:/etc/nginx/conf.d# cat /etc/nginx/conf.d/default.conf
## Basic reverse proxy server ##
## Apache (vm02) backend for www.example.com ##
upstream developserver {
server 192.168.1.100:8080; #Develop Server
}
## Lighttpd (vm01) backend for static.example.com ##
upstream productionserver {
server 192.168.1.100:8080; #Production Server
}
## Start www.example.com ##
server {
listen 10.0.3.138:80; # ip address of proxy server
server_name www.example.com;
access_log /var/log/nginx/www.example.access.log main;
error_log /var/log/nginx/www.example.error.log;
root /usr/share/nginx/html;
index index.html index.htm;
## send request back to apache1 ##
location /0.5 {
rewrite /0\.5/(.*) /$1 break;
proxy_pass http://developserver;
proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504;
proxy_redirect off;
proxy_buffering off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
location /0.7 {
proxy_pass http://productionserver;
rewrite /0\.7/(.*) /$1 break;
proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504;
proxy_redirect off;
proxy_buffering off;
proxy_set_header Host static.example.com;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
root@p1:/etc/nginx/conf.d# diff -u /etc/nginx/nginx.conf.bkp /etc/nginx/nginx.conf
--- /etc/nginx/nginx.conf.bkp 2015-08-28 14:09:19.744354204 +0800
+++ /etc/nginx/nginx.conf 2015-08-28 14:55:35.264441341 +0800
@@ -22,7 +22,9 @@
# server_names_hash_bucket_size 64;
# server_name_in_redirect off;
-
+ log_format main '$remote_addr - $remote_user [$time_local] $request '
+ '"$status" $body_bytes_sent "$http_referer" '
+ '"$http_user_agent" "$http_x_forwarded_for" "$gzip_ratio"';
include /etc/nginx/mime.types;
default_type application/octet-stream;
example/0.5/xxx ==> 192.168.1.100:8080/xxx
example/0.7/xxx ==> 192.168.1.101:8080/xxx
Here is the configuration:
引用
root@p1:/etc/nginx/conf.d# cat /etc/nginx/conf.d/default.conf
## Basic reverse proxy server ##
## Apache (vm02) backend for www.example.com ##
upstream developserver {
server 192.168.1.100:8080; #Develop Server
}
## Lighttpd (vm01) backend for static.example.com ##
upstream productionserver {
server 192.168.1.100:8080; #Production Server
}
## Start www.example.com ##
server {
listen 10.0.3.138:80; # ip address of proxy server
server_name www.example.com;
access_log /var/log/nginx/www.example.access.log main;
error_log /var/log/nginx/www.example.error.log;
root /usr/share/nginx/html;
index index.html index.htm;
## send request back to apache1 ##
location /0.5 {
rewrite /0\.5/(.*) /$1 break;
proxy_pass http://developserver;
proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504;
proxy_redirect off;
proxy_buffering off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
location /0.7 {
proxy_pass http://productionserver;
rewrite /0\.7/(.*) /$1 break;
proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504;
proxy_redirect off;
proxy_buffering off;
proxy_set_header Host static.example.com;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
引用
root@p1:/etc/nginx/conf.d# diff -u /etc/nginx/nginx.conf.bkp /etc/nginx/nginx.conf
--- /etc/nginx/nginx.conf.bkp 2015-08-28 14:09:19.744354204 +0800
+++ /etc/nginx/nginx.conf 2015-08-28 14:55:35.264441341 +0800
@@ -22,7 +22,9 @@
# server_names_hash_bucket_size 64;
# server_name_in_redirect off;
-
+ log_format main '$remote_addr - $remote_user [$time_local] $request '
+ '"$status" $body_bytes_sent "$http_referer" '
+ '"$http_user_agent" "$http_x_forwarded_for" "$gzip_ratio"';
include /etc/nginx/mime.types;
default_type application/octet-stream;
发表评论
-
使用GCC/GNU-ld删除dead code
2016-05-09 17:18 663[url] https://gcc.gnu.org/ml/gc ... -
python 修饰器
2016-02-05 15:11 426def wrapper1(function): ... -
ubuntu 14.04 install e431 wifi driver
2016-01-25 20:59 463引用 sudo apt-get install linu ... -
git
2016-01-07 12:01 461http://finalshares.cn/attachmen ... -
嵌入式中使用gdb
2016-01-06 17:38 3715编译 For gdb: /path/to/gdb-sr ... -
linux change boot image
2016-01-02 00:55 5501. change grub2 引用vim /etc/defa ... -
binwalk --dd
2015-12-28 21:51 1431http://www.devttys0.com/2012/12 ... -
embeded LD_PRELOAD
2015-12-28 00:17 577引用 eve@eve:~/squashfs-root$ sud ... -
hardware hacking
2015-12-27 01:32 706For video stuff: https://www.yo ... -
ubuntu support kindle
2015-12-20 23:13 380引用apt-get install mtpfs -
linux 备份系统
2015-12-05 22:22 427引用备份 dd if=/dev/sda > myimag ... -
[译]root权限运行vlc
2015-11-30 22:19 1420原文地址:http://www.blackmoreops.co ... -
【转】关闭TCP Timestamps来节省一点带宽
2015-10-15 23:29 1660http://highscalability.com/blog ... -
[转]Terminal escape sequences – the new XSS for Linux sysadmins
2015-09-25 23:58 448https://ma.ttias.be/terminal-es ... -
ipython basic
2015-09-25 11:31 482Introspection引用 Using a questio ... -
static in C
2015-09-22 11:35 326jason@ubuntu:~/test$ cat a.c ... -
lxc重命名容器名
2015-09-20 00:25 830lxc-ls 使用文件夹名作为容器名。所以可以更改文件夹名称来 ... -
lxc更新apt源
2015-09-18 11:49 773最近一直在使用lxc创建容器,每次创建一个容器都需要把apt源 ... -
wireshark:Couldn't run /usr/bin/dumpcap in child process: Permission denied
2015-09-11 10:26 3393When start wireshark, I met an ... -
[转]调试python内存泄漏
2015-09-09 00:48 388http://chase-seibert.github.io/ ...
相关推荐
反向代理(Reverse Proxy)是一种常用的网络架构模式,通过使用反向代理,可以将客户端的请求转发到内部服务器,提高了网络安全性和负载均衡能力。 在本文中,我们将介绍如何使用 Nginx 配置反向代理,实现 ...
`nginx-proxy`是一个流行的Docker容器,它可以自动处理容器的网络配置,为每个容器分配一个虚拟主机。要使用`nginx-proxy`,首先需要启动它: ```bash docker run -d --name nginx-proxy \ -v /var/run/docker....
Run an NGINX reverse proxy with SSL in front of a specified port. positional arguments: CMD 'up' or 'down' flag arguments: -h, --help show this help message and exit -n, --name NAME Docker cont
# description: nginx is a HTTP and reverse proxy server # ### BEGIN INIT INFO # Provides: nginx # Required-Start: $local_fs $remote_fs $network # Required-Stop: $local_fs $remote_fs $network # Default...
nginx 反向代理官方文档: NGINX REVERSE PROXY 当在一台主机上部署了多个不同的web服务器,并且需要能在80端口同时访问这些web服务器时,可以使用 nginx 的反向代理功能: 用 nginx 在80端口监听所有请求,并依据转发...
快速开始docker run \ -ti \ --rm \ -name nginx-fpm-reverse-proxy \ -v ${pwd}:/opt/kimai \ -p 8001:80 \tobybatch/nginx-fpm-reverse-proxy建造没有自定义构建时间: docker build .环境变量PORT=80 Nginx服务器...
ecs-nginx-proxy:AWS ECS的反向代理。 让您按子域寻址Docker容器
containerized_nginx_reverse_proxy Nginx和应用程序都在Docker容器中的反向代理演示
# description: Nginx is an HTTP server and a reverse proxy server. # processname: nginx # config: /etc/nginx/nginx.conf # pidfile: /var/run/nginx/nginx.pid # lockfile: /var/lock/subsys/nginx # ...
EwoMail是基于Linux的开源邮件服务器软件,集成了众多优秀稳定的组件,是一个快速部署、简单高效、多语言、安全稳定的邮件解决方案。帮助你提升运维效率,降低 IT 成本,兼容主流的邮件客户端,同时支持电脑和手机...
This book is about NGINX the web server, reverse proxy, load balancer, and HTTP cache. Part I will focus mostly on the load-balancing aspect and the advanced features around load balancing, as well ...
问题 在之前的分享的跨域资源共享的文章中,有提到要注意跨域时,如果要发送Cookie,Access-Control-Allow-Origin就不能设为*,必须指定明确的、与请求网页...反向代理(Reverse Proxy)方式是指以代理服务器来接受In
重要的每当您第一次运行时,都必须重新加载nginx配置文件。 可以通过键入以下命令来... Nginx公开了80个(默认)和8069个端口(在dockerfile文件中指定) 在docker-compose文件中,odoo_proxy(nginx)发布8069端口。
Description=The nginx HTTP and reverse proxy server After=network.target remote-fs.target nss-lookup.target [Service] Type=forking PIDFile=/usr/local/nginx/logs/nginx.pid ExecStartPre=/usr/local...
<description>Nginx HTTP and reverse proxy server. <executable>C:\path\to\nginx.exe <arguments>-g "daemon off;" ``` 这里`<id>`是服务的唯一标识,`<name>`和`<description>`是显示的服务名和描述,`...
我们米扑科技的业务遍布全球,有时国外的客户无法访问我们搭建在国内的服务,这就要求我们...nginx 反向代理官方文档: NGINX REVERSE PROXY 当在一台主机上部署了多个不同的web服务器,并且需要能在80和443端口同时访问
2. **Reverse Proxy Cache**:作为反向代理服务器,Nginx 可以缓存来自上游服务器的数据。这在内容经常变化但更新频率较低的应用程序中特别有用。 - 配置示例: ```nginx http { ... proxy_cache_path /var/...
docker-nginx-reverse-proxy-with-tests 展示如何使用 WireMock 为 dockerized NGINX 实例编写自动化测试的简单项目。 有关更多信息,请参阅我的 环境设置 要在本地运行运行... ./buildRunAndTest.sh ##图表
Nginx与Apache反向代理配置生成器 该脚本根据您传递给它的参数生成Nginx vhost配置。 .vhost文件与使用Nginx作为Apache的反向代理兼容。 随时根据您的需求进行调整。 它还会在/ var / log / nginx / vhosts / ...
Nginx作为Docker容器的反向代理 关于 该存储库是如何使用NGINX Docker容器作为反向代理的示例,该代理是在其他Dockers容器中运行的另一个应用程序的。 什么是反向代理 来自NGINX页面的定义: 代理服务器是介于中间...