惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

V
Visual Studio Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
T
The Blog of Author Tim Ferriss
宝玉的分享
宝玉的分享
The Register - Security
The Register - Security
D
Docker
The Cloudflare Blog
A
About on SuperTechFans
Microsoft Security Blog
Microsoft Security Blog
Recent Announcements
Recent Announcements
月光博客
月光博客
B
Blog RSS Feed
博客园 - 【当耐特】
The GitHub Blog
The GitHub Blog
B
Blog
IT之家
IT之家
美团技术团队
Engineering at Meta
Engineering at Meta
C
Check Point Blog
云风的 BLOG
云风的 BLOG
Last Week in AI
Last Week in AI
G
Google Developers Blog
MongoDB | Blog
MongoDB | Blog
Microsoft Azure Blog
Microsoft Azure Blog
S
SegmentFault 最新的问题
V
V2EX
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Apple Machine Learning Research
Apple Machine Learning Research
U
Unit 42
H
Help Net Security
雷峰网
雷峰网
人人都是产品经理
人人都是产品经理
博客园 - 司徒正美
Stack Overflow Blog
Stack Overflow Blog
博客园 - Franky
PCI Perspectives
PCI Perspectives
J
Java Code Geeks
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
M
MIT News - Artificial intelligence
腾讯CDC
A
Arctic Wolf
C
CERT Recently Published Vulnerability Notes
量子位
C
CXSECURITY Database RSS Feed - CXSecurity.com
Latest news
Latest news
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
The Hacker News
The Hacker News
有赞技术团队
有赞技术团队
Schneier on Security
Schneier on Security
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻

博客园 - 接云网络

.Net5开发MQTT服务器 使用Docker搭建MQTT服务器 使用Docker搭建MQTT服务器 在Raspberry Pi上安装Docker 阿里云=>RHSA-2019:1884-中危: libssh2 安全更新 MediaAPIController CentOS7 mysql支持中文 设置centos7中的mysql5.7不区分表名大小写有关操作 CentOS7 安装mysql(YUM源方式) centos7下安装nginx CentOS7利用systemctl添加dotnet后台服务 CentOS7利用systemctl添加自定义系统服务 mysql 8.0.13开启远程连接 配置方式 vue 父子组件数据的双向绑定大法 .NET Core 3.0 发布单文件可执行程序 asp.net core In Docker(Image) ASP.NET Core 2.1 使用Docker运行 postman 发送json请求 Simple ASP.NET CORE 2.2 App +Vue JS
Debian 8 安装Nginx最新版本
接云网络 · 2019-09-20 · via 博客园 - 接云网络

在Debian下如果直接apt-get install nginx直接装发现nginx版本是很旧的,本文主要讲一下如何在Debian 8上装新版的nginx。

原文资料:https://nginx.org/en/linux_packages.html,如果英文不错的话,可以直接阅读官方文档。

一、清理残余的旧版本

sudo apt-get remove nginx nginx-common nginx-full

二、安装nginx PGP签名文件

wget http://nginx.org/keys/nginx_signing.key
sudo apt-key add nginx_signing.key

三、使用sudo修改source源

codename参数根据os来选择:https://nginx.org/en/linux_packages.html#distributions

比如我的OS是Debian 8 jessie,codename参数即为jessie

使用sudo编辑/etc/apt/source.list文件

sudo vim /etc/apt/source.list

在文件末追加以下:

deb http://nginx.org/packages/mainline/debian/ [codename] nginx
deb-src http://nginx.org/packages/mainline/debian/ [codename] nginx

eg:

deb http://nginx.org/packages/mainline/debian/ jessie nginx
deb-src http://nginx.org/packages/mainline/debian/ jessie nginx

四、更新软件源并安装nginx

sudo apt-get update
sudo apt-get install nginx

五、查看nginx版本号

六、nginx启动

sudo service nginx start
sudo service nginx restart
sudo service nginx reload
sudo service nginx stop

七.配置

vim /etc/nginx/sites-available/default
 server{
        listen 80;
	access_log  logs/www.***.cn.log  main;
        server_name www.***.cn; #绑定域名
        location / {
            proxy_pass  http://localhost:7777;
	    proxy_set_header Host $host;
	    proxy_set_header X-Real-IP $remote_addr;
	    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        }
    }