nginx在windows下配置反向代理
转自:https://blog.csdn.net/comeonyangzi/article/details/72466310
下载地址:http://nginx.org/download/
下载后直接解压到你的硬盘上 解压
启动nginx 以管理员身份运行
nginx
查看任务任务管理器里面会有nginx的进程
在浏览器输入http://127.0.0.1 此时会出现nginx的欢迎界面,说明启动nginx成功。
Welcome to nginx!
If you see this page, the nginx web server is successfully installed and working. Further configuration is required.
For online documentation and support please refer to nginx.org.
Commercial support is available at nginx.com.
Thank you for using nginx.
其他操作: 管理员身份运行cmd
nginx -s stop // 停止nginx
nginx -s reload // 重新加载配置文件
nginx -s quit // 退出nginx
nginx反向代理配置:
找到conf/nginx.conf文件,编辑:
worker_processes 1;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
server {
listen 8001;
server_name localhost;
#charset koi8-r;
#access_log logs/host.access.log main;
location / {
proxy_pass http://192.168.126.93:10080;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
}
server下的结点:
listen:监听80端口
server_name:转发到哪个地址
proxy_pass:代理到哪个地址
nginx在windows下配置反向代理的更多相关文章
- Centos 7 上使用nginx为Node.js配置反向代理时错误:(13: Permission denied) while connecting to upstream
错误来源:Centos 7 上使用nginx为Node.js配置反向代理时产生(13: Permission denied) while connecting to upstream的错误 nginx ...
- ubuntu下配置反向代理
1. 环境 ubuntu:Ubuntu 13.04 x86-64 apache2: 2.2.22-6ubuntu5.1 amd64 2. 配置 2.1 配置应用 增加监听端口 打开/etc/apac ...
- ubuntu apache2 .htaccess 下配置 反向代理
安装完apache2后, a2enmod rewrite //启用.htaccess规则 a2enmod proxy a2enmod proxy_http //启用反向代理支持 [P] 配置OK,就可 ...
- Nginx + django windows下配置
1.下载nginx, 去http://nginx.org/en/download.html 下载,我下载的是1.8 stable版本. 2.配置文件/conf/nginx.conf #user nob ...
- 【Asp.net Core】在 Linux 子系统中安装 nginx 并配置反向代理
上一篇鸟文中,老周已经介绍过在 Ubuntu 子系统中安装 dotnet-sdk 的方法,本文老周给大伙伴们说说安装 nginx 服务,并配置反向代理.同样,老周假设你从来没有用过 Linux,所以老 ...
- CentOS7 Nginx安装及配置反向代理
背景: Mono (Mono JIT compiler version 5.4.0.201 ) jexus-5.8.2-x64(<CentOS7 安装 jexus-5.8.2-x64>) ...
- nginx配置反向代理详细教程(windows版)
内容属于原创,如果需要转载,还请注明地址:http://www.cnblogs.com/j-star/p/8785334.html Nginx是一款轻量级的Web 服务器/反向代理服务器及电子邮件(I ...
- windows版 nginx配置反向代理实例教程 跳转tomcat和php网站
抄自 https://www.cnblogs.com/j-star/p/8785334.html 个人理解 nginx端口设置为80,简称n tomcat端口设置为其他,例如8080,简称t php网 ...
- windows 下配置 Nginx 常见问题(转)
windows 下配置 Nginx 常见问题 因为最近的项目需要用到负载均衡,不用考虑,当然用大名鼎鼎的Nginx啦.至于Nginx的介绍,这里就不多说了,直接进入主题如何在Windows下配置. 我 ...
随机推荐
- Python字典实现
这篇文章描述了在Python中字典是如何实现的. 字典通过键(key)来索引,它可以被看做是关联数组.我们在一个字典中添加3个键/值对: >>> d = {'a': 1, 'b': ...
- AtCoder AGC002E Candy Piles (博弈论)
神仙题..表示自己智商不够想不到... 好几次读成最后拿的赢了,导致一直没看懂题解... 题目链接: https://atcoder.jp/contests/agc002/tasks/agc002_e ...
- Spring Boot教程(十四)快速入门
快速入门 本章主要目标完成Spring Boot基础项目的构建,并且实现一个简单的Http请求处理,通过这个例子对Spring Boot有一个初步的了解,并体验其结构简单.开发快速的特性. 系统要求: ...
- 模板引擎ejs的include方法
html无法include header.ejs footer.ejs 最后用 user.ejs在首尾include
- spring boot shiro redis整合基于角色和权限的安全管理-Java编程
一.概述 本博客主要讲解spring boot整合Apache的shiro框架,实现基于角色的安全访问控制或者基于权限的访问安全控制,其中还使用到分布式缓存redis进行用户认证信息的缓存,减少数据库 ...
- springboot+mybatis+SpringSecurity 实现用户角色数据库管理(一)
本文使用springboot+mybatis+SpringSecurity 实现用户权限数据库管理 实现用户和角色用数据库存储,而资源(url)和权限的对应采用硬编码配置. 也就是角色可以访问的权限通 ...
- iptables添加、删除端口
简洁才是王道, 下面是添加一个udp端口,端口号8566,即接收到8566端口的所有udp包 /sbin/iptables -I INPUT -p udp --dport -j ACCEPT 要删除这 ...
- a = a + b 与 a += b 的区别
1.对于同样类型的a,b来说 两个式子执行的结果确实没有什么区别.但是从编译的角度看吧(武让说的),a+=b;执行的时候效率高. 2.对于不同类型的a,b来说 2.1 不同类型的两个变量在进行运 ...
- pgAdmin III 使用图解
pgAdmin III简介 要打开一个到服务的连接,在树中选择所需的服务,并双击它,或使用“工具”菜单上的连接即可. 一.主窗体 在主窗口中,显示数据库的结构.您可以创建新的对象,删除和编辑现有的对象 ...
- C#采集:图灵机器人信息
Dictionary<string, string> users = new Dictionary<string, string>(); users.Add("use ...