Nginx 配置 HTTP 代理
Posted vipsoft
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Nginx 配置 HTTP 代理相关的知识,希望对你有一定的参考价值。
配置如下
#user nobody; worker_processes 1; #error_log logs/error.log; #error_log logs/error.log notice; #error_log logs/error.log info; #pid logs/nginx.pid; events worker_connections 1024; http include mime.types; default_type application/octet-stream; #log_format main ‘$remote_addr - $remote_user [$time_local] "$request" ‘ # ‘$status $body_bytes_sent "$http_referer" ‘ # ‘"$http_user_agent" "$http_x_forwarded_for"‘; #access_log logs/access.log main; sendfile on; #tcp_nopush on; #keepalive_timeout 0; keepalive_timeout 65; #gzip on; upstream tomcats server 172.17.127.160:8081; server 172.17.127.160:8082; server 172.17.127.160:8083; server listen 80; server_name localhost; #charset koi8-r; #access_log logs/host.access.log main; location / #root html; proxy_pass http://tomcats; index index.html index.htm; #error_page 404 /404.html; # redirect server error pages to the static page /50x.html # error_page 500 502 503 504 /50x.html; location = /50x.html root html;
以上是关于Nginx 配置 HTTP 代理的主要内容,如果未能解决你的问题,请参考以下文章
如何用 Nginx 配置透明 HTTP 和 HTTPS 代理
如何用 Nginx 配置透明 HTTP 和 HTTPS 代理