Nginx Web服务器反向代理的命令

开发 前端
Nginx Web服务器需要我们学习的还有很多,Nginx Web服务器中的反向代理配置的时候需要我们不断的学习。下面我们就看看如何才能更好掌握。

Nginx Web服务器有很多需要我们掌握的知识,其中在进行反向代理配置文件的时候就需要我们格外的注意。下面我们就来仔细研究下有关于Nginx Web服务器的反向代理的命令操作。

user www www;  
worker_processes 10;  
error_log /var/nginx/logs/error.log;  
#error_log logs/error.log notice;  
#error_log logs/error.log info;  
pid /var/nginx/nginx.pid;  
worker_rlimit_nofile 51200;  
events  
{  
use epoll;  
worker_connections 51200;  
}  
http  
{  
include mime.types;  
default_type application/octet-stream;  
keepalive_timeout 120;  
tcp_nodelay on;  
upstream localhost{  
ip_hash;  
server 10.40.0.46;  
server 10.40.0.47;  
server 10.40.0.48;  
}  
upstream blog.s135.com {  
server 192.168.1.7:8080;  
server 192.168.1.7:8081;  
server 192.168.1.7:8082;  
}  
server  
{  
listen 80;  
server_name localhost;  
location / {  
proxy_pass http://localhost;  
proxy_set_header Host $host;  
proxy_set_header X-Real-IP $remote_addr;  
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;  
}  
log_format localhost '$remote_addr - $remote_user [$time_local] $request '  
'"$status" $body_bytes_sent "$http_referer" '  
'"$http_user_agent" "$http_x_forwarded_for"';  
access_log /var/nginx/logs/www.log localhost;  
}  

  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.
  • 21.
  • 22.
  • 23.
  • 24.
  • 25.
  • 26.
  • 27.
  • 28.
  • 29.
  • 30.
  • 31.
  • 32.
  • 33.
  • 34.
  • 35.
  • 36.
  • 37.
  • 38.
  • 39.
  • 40.
  • 41.
  • 42.
  • 43.
  • 44.
  • 45.

以上就是对Nginx Web服务器的详细介绍。

【编辑推荐】

  1. Nginx http服务相关的配置文件
  2. Nginx服务器如何配合Java开发项目
  3. Nginx服务器备受瞩目的原因
  4. nginx静态文件的配置与安全认定
  5. 深入学习有关Nginx负载均衡的安装过程
责任编辑:张浩 来源: 互联网
相关推荐

2009-02-28 14:23:02

2010-03-30 14:35:58

Nginx反向代理

2019-04-08 08:39:47

Nginx代理服务器

2018-11-05 09:34:43

2011-08-31 16:37:51

Nginx

2019-04-03 11:22:06

NginxApacheweb服务器

2019-05-14 09:39:07

Web服务器Web容器应用程序服务器

2019-06-27 08:43:26

服务器Nginx反向代理

2018-10-14 08:39:52

NginxTomcat服务器

2019-04-24 15:13:16

Web服务器应用服务器Web容器

2012-04-02 14:31:06

nginx代理缓存

2017-09-20 10:22:15

Web服务器容器

2018-04-17 12:10:40

2012-09-18 09:55:28

2021-08-04 07:26:07

IIS服务器反向代理

2019-10-22 10:20:13

Nginx反向代理服务器

2012-04-02 14:25:12

squid缓存

2015-09-06 09:53:41

DockerWeave

2022-07-01 07:33:24

nginx反向代理测试

2018-11-12 12:17:00

点赞
收藏

51CTO技术栈公众号