首先介绍一下Nginx的基本使用:

注意不要直接双击nginx.exe,这样会导致修改配置后重启、停止nginx无效,需要手动关闭任务管理器内的所有nginx进程

在nginx.exe目录,打开命令行工具,用命令 启动/关闭/重启nginx

start nginx : 启动nginx

nginx -s reload :修改配置后重新加载生效

nginx -s reopen :重新打开日志文件

nginx -t -c /path/to/nginx.conf 测试nginx配置文件是否正确

关闭nginx:

nginx -s stop :快速停止nginx

nginx -s quit :完整有序的停止nginx

如果遇到报错:

bash: nginx: command not found

有可能是你再linux命令行环境下运行了windows命令,

如果你之前是允许 nginx -s reload报错, 试下 ./nginx -s reload

或者 用windows系统自带命令行工具运行

nginx配置webservice

#user nobody;

worker_processes 4;

#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;

upstream esbServer {

server 127.0.0.1:8083 weight=1 max_fails=2 fail_timeout=30s;

}

#gzip on;

server {

listen 8081;

server_name localhost;

#charset koi8-r;

#access_log logs/host.access.log main;

location /ladder_web {

proxy_set_header X-real-ip $remote_addr;

proxy_pass http://esbServer;

}

}

}

nginx 配置mysql代理-- 基于nginx1.9以上 stream module

stream 模块用于一般的 TCP 代理和负载均衡。

#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;

}

stream {

upstream sql {

server 172.16.10.229:3306 weight=1 max_fails=2 fail_timeout=30s;

}

server {

listen 3333;

proxy_connect_timeout 1s;

proxy_timeout 3s;

proxy_pass sql;

}

}

nginx配置Sql server服务代理

#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;

}

stream {

upstream sqlserver {

server 172.16.10.167:1433 weight=1 max_fails=2 fail_timeout=30s;

}

server {

listen 3334;

proxy_connect_timeout 1s;

proxy_timeout 3s;

proxy_pass sqlserver;

}

}

nginx配置Oracle代理

#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;

}

stream {

upstream oracle {

server 172.16.10.222:1521 weight=1 max_fails=2 fail_timeout=30s;

}

server {

listen 3335;

proxy_connect_timeout 1s;

proxy_timeout 3s;

proxy_pass oracle;

}

}

webservice mysql配置_Nginx配置WebService、MySQL、SQL Server、ORACLE等代理相关推荐

  1. oracle rds 运维服务_从运维的角度分析使用阿里云数据库RDS的必要性–你不应该在阿里云上使用自建的MySQL/SQL Server/Oracle/PostgreSQL数据库...

    开宗明义,你不应该在阿里云上使用自建的MySQL or SQL Server数据库,对了,还有Oracle or PostgreSQL数据库. 云数据库 RDS(Relational Database ...

  2. oracle sql为null值,在SQL Server Oracle MySQL当数据库中查出某值为NULL怎么办

    在SQL Server Oracle MySQL当数据库中查出某值为NULL怎么办? 1.MSSQL: ISNULL() 语法 ISNULL ( check_expression , replacem ...

  3. SQL Server,Oracle,DB2索引建立语句的对比

    http://database.51cto.com/art/201108/284540.htm SQL Server,Oracle,DB2索引建立语句的对比 2011-08-17 20:48 henr ...

  4. VB连接Sql Server,Oracle,SyBase,Access数据库操作实例

    - VB连接数据库是常用的操作 对于小型数据的存取是非常不错的.在设计时 对于不同数据的连接方式都不同 这里使用了ADODB连接字符串的方式来访问常见的数据库:Sql Server,Oracle,Sy ...

  5. SQL Server 中查看代理作业记录日志的方法有哪些?

    查看代理作业记录日志 Microsoft SQL Server Management Studio Transact-SQL SQL Server 管理对象 在实际应用中,我们可以通过 Microso ...

  6. mysql物理读和逻辑读,SQL Server中STATISTICS IO物理读和逻辑读的误区

    SQL Server中STATISTICS IO物理读和逻辑读的误区 人人知道,SQL Server中可以行使下面下令查看某个语句读写IO的情形 SET STATISTICS IO ON 那么这个下令 ...

  7. ef mysql modelfirst_MySQL –EF edmx(Model First)– Sql Server table

    一.mysql environment When we create an new database,first We need draw er diagram for somebody to sho ...

  8. ado.net mysql 连接池_ADO.NET中SQL Server数据库连接池

    实际上,大多数应用程序仅使用一个或几个不同的连接配置. 这意味着在执行应用程序期间,许多相同的连接将反复地打开和关闭. 为了使打开的连接成本最低,ADO.NET 使用称为连接池的优化方法. 连接池减少 ...

  9. 数据库连接字符串 mysql_数据库连接字符串(MySQL,SQL Server,Oracle)

    数据库连接字符串(在java中使用) =====MySQL===== String driverClass="com.mysql.jdbc.Driver; String url=" ...

最新文章

  1. 微软推出新逆天开源语言Bosque,告别 for 循环,提高开发效率!
  2. java使用教程——组件及事件处理——菜单(添加图标)
  3. 计算机软件在矿井地质中的应用,(完整版)遥感导论知识点整理(梅安新版)
  4. HDU5977-Garden of Eden-树分治+FWT
  5. JMS 在 SpringBoot 中的使用
  6. [面试]如何写testcase?
  7. LabView学习笔记(二):滤波器实验
  8. python 主线程_Python 主线程捕获子线程异常
  9. SSM整合(spring mybatis)图书
  10. apache poi处理表格示例
  11. 20200614每日一句
  12. 什么转换器能将excel转换成pdf
  13. react ssr php,从零开始搭建React同构应用(三):配置SSR
  14. idm bt种子下载如何提升速度?
  15. Spring中的 @Lazy注解简析
  16. Excel如何将多行数据合并为一行并添加间隔符号
  17. 淘宝商品详情接口(商品详情页面数据接口)
  18. 三菱FX3U PLC 位置式PID算法(ST语言)
  19. 云函数调用失败的原因
  20. python3--opencc安装方式

热门文章

  1. UWP开发入门(十九)——10分钟学会在VS2015中使用Git
  2. Android系统shell中的clear命令实现
  3. mac编译openresty报Undefined symbols for architecture x86_64
  4. 重装windows2003遇到的老问题:0X0000007B和显卡驱动安装不上。
  5. windows 7作为微软对抗Google的秘密武器
  6. 一个httpwebrequest异步下载的例子
  7. nmap命令_白帽子黑客教你:如何用Nmap探测目标主机操作系统类型?
  8. win mysql 最大连接_常用的三种修改mysql最大连接数的方法
  9. guns 最新开源框架企业版下载_优秀!Github上10个开源免费的后台控制面板你值得拥有!...
  10. nginx php-fpm display_errors,php5-fpm的display_errors不能使用nginx