nginx stream 模块的应用 博客分类: nginx
程序员文章站
2024-03-19 20:06:10
...
nginx 作为反向代理服务器,通常以7层网络代理为主 , 特殊情况下 也可以进行4层网络代理,实现所谓的透传,以下是一个实例
user nginx; worker_processes auto; error_log /var/log/nginx/error.log; pid /run/nginx.pid; include /usr/share/nginx/modules/*.conf; events { worker_connections 1024; } stream { upstream localhost-443 { server 127.0.0.1:{{grafana_web_port}}; } server { listen 443 ; proxy_pass localhost-443; } } http { 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 /var/log/nginx/access.log main; sendfile on; tcp_nopush on; tcp_nodelay on; keepalive_timeout 65; types_hash_max_size 2048; include /etc/nginx/mime.types; default_type application/octet-stream; include /etc/nginx/conf.d/*.conf; upstream platform-t{ server 127.0.0.1:8443; } server { listen 444 ; server_name _; root /usr/share/nginx/html; index index.html index.htm; ssl on; ssl_certificate /opt/cert/server.crt; ssl_certificate_key /opt/cert/server.key; # Load configuration files for the default server block. location /profile { proxy_pass https://platform-t; } error_page 404 /404.html; location = /40x.html { } error_page 500 502 503 504 /50x.html; location = /50x.html { } } }
推荐阅读
-
【Nginx、LVS及HAProxy负载均衡软件的优缺点】 博客分类: 负载均衡 【Nginx、LVS及HAProxy负载均衡软件的优缺点】
-
Nginx的location if 太奇怪了 博客分类: nginx&varnish nginxlocation
-
Nginx和Apache取消带验证目录的子目录验证的方法 博客分类: web服务器
-
nginx stream 模块的应用 博客分类: nginx
-
nginx stream 模块的应用 博客分类: nginx
-
nginx缓存模块ngx_cache_purge配置 博客分类: nginx cachenginx
-
实现基于nginx的tomcat负载均衡和集群配置 博客分类: 实战技术 nginxtomcatmemcached
-
linux下nginx安装,启动,停止,卸载,平滑升级,添加模块 博客分类: nginx nginx安装启动停止添加模块
-
nginx上传模块下载安装 博客分类: nginx nginx上传upload
-
Nginx 开启 stub_status 模块监控 博客分类: nginx nginxnginx-statusstub_status监控