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:8080 weight=5;
## #server https://www.newhealth.com.cn/audit/;
# server 172.17.127.160:8081;
# server 172.17.127.160:8082;
# server 172.17.127.160:8083;
# server 172.17.127.153:8087;
# server www.ironfo.com;
server www.ironfo.com;
} 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;
} # proxy the PHP scripts to Apache listening on 127.0.0.1:80
#
#location ~ \.php$ {
# proxy_pass http://127.0.0.1;
#} # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
#location ~ \.php$ {
# root html;
# fastcgi_pass 127.0.0.1:9000;
# fastcgi_index index.php;
# fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
# include fastcgi_params;
#} # deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
#location ~ /\.ht {
# deny all;
#}
} # another virtual host using mix of IP-, name-, and port-based configuration
#
#server {
# listen 8000;
# listen somename:8080;
# server_name somename alias another.alias; # location / {
# root html;
# index index.html index.htm;
# }
#} # HTTPS server
#
#server {
# listen 443 ssl;
# server_name localhost; # ssl_certificate cert.pem;
# ssl_certificate_key cert.key; # ssl_session_cache shared:SSL:1m;
# ssl_session_timeout 5m; # ssl_ciphers HIGH:!aNULL:!MD5;
# ssl_prefer_server_ciphers on; # location / {
# root html;
# index index.html index.htm;
# }
#} }
Nginx 配置 HTTP 代理的更多相关文章
- Windos环境用Nginx配置反向代理和负载均衡
Windos环境用Nginx配置反向代理和负载均衡 引言:在前后端分离架构下,难免会遇到跨域问题.目前的解决方案大致有JSONP,反向代理,CORS这三种方式.JSONP兼容性良好,最大的缺点是只支持 ...
- Linux - Nginx配置反向代理。
Nginx配置反向代理. 准备两台服务器 http://192.168.70.66 http://192.168.70.62 设置正则匹配(192.168.70.66) vim /usr/local/ ...
- CentOS 7 安装 Nginx 配置反向代理
Linux使用Nginx Yum存储库上安装Nginx,适用于Red Hat Enterprise Linux和CentOS系统. 1.添加设置Nginx Yum存储库 在CentOS中首次安装Ngi ...
- [笔记]nginx配置反向代理和负载均衡
1.nginx配置文件:源码安装情况下,nginx.conf在解压后的安装包内.yum安装,一般情况下,一部分在/etc/nginx/nginx.conf中,一部分在/etc/nginx/conf.d ...
- nginx 配置方向代理出错 The character [_] is never valid in a domain name
nginx 配置方向代理出错 The character [_] is never valid in a domain name 下面是配置信息: 原因是使用的tomcat为8及以上的版本时upstr ...
- nginx配置反向代理或跳转出现400问题处理记录
午休完上班后,同事说测试站点访问接口出现400 Bad Request Request Header Or Cookie Too Large提示,心想还好是测试服务器出现问题,影响不大,不过也赶紧上 ...
- nginx配置反向代理详细教程(windows版)
内容属于原创,如果需要转载,还请注明地址:http://www.cnblogs.com/j-star/p/8785334.html Nginx是一款轻量级的Web 服务器/反向代理服务器及电子邮件(I ...
- nginx笔记 安装nginx 配置 反向代理 多虚拟主机
1,检测linux上是否 通过yum安装了nginxrpm -qi nginx 2.安装nginx之前的依赖包yum install gcc patch libffi-devel python- ...
- Nginx 配置TCP代理
Nginx 1.9 版本以后增加了stream模块,可以对tcp,udp请求进行代理和负载均衡了,今天来体验一下首先编译安装过程configure的时候增加选项 --with-stream --wit ...
- windows版 nginx配置反向代理实例教程 跳转tomcat和php网站
抄自 https://www.cnblogs.com/j-star/p/8785334.html 个人理解 nginx端口设置为80,简称n tomcat端口设置为其他,例如8080,简称t php网 ...
随机推荐
- Java入门(二)——泛型
如果你写过前端,可能会经常写一下关于变量类型的判断,比如:typeof fn === 'function'之类的代码.因为JavaScript作为一门弱类型语言,类型的判断往往需要开发人员自己去检查. ...
- XAMPP + PhpStorm + Xdebug本地实验环境搭建
参考: 下载合适的XDebug 点击这里,选择合适xdebug XAMPP配置 php_xdebug-xxxx.dll 拷贝dll至 D:\XAMPP\php\ext php.ini 文末追加 [XD ...
- Gtest:事件
前言 有时候在测试的时候,我们会在测试前做一些初始化活动,和测试后做一些清理工作,gtest提供了多种事件机制,非常方便我们在案例之前或之后做一些操作.总结一下gtest的事件一共有3种: 全局的,所 ...
- 18.centos7基础学习与积累-004-分区理论
1.从头开始积累centos7系统运用 大牛博客:https://blog.51cto.com/yangrong/p5 1.常规分区:数据不是特别重要的业务(集群的某个节点) /boot 引导分区 ...
- jetbreains的crack方法
https://zhile.io/2018/08/20/jetbrains-license-server-crack.html
- Environment类在代码中的使用
string environmentVariable = Environment.GetEnvironmentVariable("TrustMerchantIniFile"); 可 ...
- SQL进阶系列之11让SQL飞起来
写在前面 SQL的性能优化是数据库使用者必须面对的重要问题,本节侧重SQL写法上的优化,SQL的性能同时还受到具体数据库的功能特点影响,这些不在本节讨论范围之内 使用高效的查询 参数是子查询时,使用E ...
- springboot 2.x整合redis,spring aop实现接口缓存
pox.xml: <dependency> <groupId>org.springframework.boot</groupId> <artifactId&g ...
- docker-compose部署gitlab
一.安装docker-compose步骤可参考本博客其他文章 二.这里的ssl证书是使用letsencrypt生成,可参考文档https://my.oschina.net/u/3042999/blog ...
- 代码中的mysql语法问题
今天在代码中写了mysql的删除语句 String lpinsuredSQL=" delete from lpinsured a where a.insuredid='?InsuredID? ...