nginx安装,yum问题,make问题 nginx yum
程序员文章站
2022-03-01 22:17:39
...
一
首先总体按照
https://github.com/caojx-git/learn/blob/master/notes/nginx/nginx%E4%BD%BF%E7%94%A8stream%E6%A8%A1%E5%9D%97%E5%81%9Assh%E8%BD%AC%E5%8F%91.md
里面的安装流程。
二
注意如果不能访问外网,检查文件:
/etc/yum.repos.d/rhel-source.repo
其中的 baseUrl 表示下载镜像
也可以配置为本地目录
三
安装nginx时,提示nginx.conf文件存在
可以将这一步改一下
./configure --prefix=/usr/local/nginx
TO
./configure --prefix=/usr/local/nginx --conf-path=/usr/local/nginx/nginx.conf
然后配置文件路径就调整到nginx/nginx.conf位置
配置多个转发
stream段的配置要与http段在同级目录。此处引用的为官方nginx说明配置。
stream {
upstream backend {
hash $remote_addr consistent;
server backend1.example.com:12345 weight=5;
server 127.0.0.1:12345 max_fails=3 fail_timeout=30s;
server unix:/tmp/backend3;
}
upstream dns {
server 192.168.0.1:53535 max_fails=1 fail_timeout=3s;
#server 127.0.0.1:8080 backup; 备
}
server {
listen 12345;
proxy_connect_timeout 1s;
proxy_timeout 3s;
proxy_pass backend;
}
server {
listen 127.0.0.1:53 udp reuseport;
proxy_timeout 20s;
proxy_pass dns;
}
server {
listen [::1]:12345;
proxy_pass unix:/tmp/stream.socket;
}
}
首先总体按照
https://github.com/caojx-git/learn/blob/master/notes/nginx/nginx%E4%BD%BF%E7%94%A8stream%E6%A8%A1%E5%9D%97%E5%81%9Assh%E8%BD%AC%E5%8F%91.md
里面的安装流程。
二
注意如果不能访问外网,检查文件:
/etc/yum.repos.d/rhel-source.repo
其中的 baseUrl 表示下载镜像
也可以配置为本地目录
三
安装nginx时,提示nginx.conf文件存在
可以将这一步改一下
./configure --prefix=/usr/local/nginx
TO
./configure --prefix=/usr/local/nginx --conf-path=/usr/local/nginx/nginx.conf
然后配置文件路径就调整到nginx/nginx.conf位置
配置多个转发
stream段的配置要与http段在同级目录。此处引用的为官方nginx说明配置。
stream {
upstream backend {
hash $remote_addr consistent;
server backend1.example.com:12345 weight=5;
server 127.0.0.1:12345 max_fails=3 fail_timeout=30s;
server unix:/tmp/backend3;
}
upstream dns {
server 192.168.0.1:53535 max_fails=1 fail_timeout=3s;
#server 127.0.0.1:8080 backup; 备
}
server {
listen 12345;
proxy_connect_timeout 1s;
proxy_timeout 3s;
proxy_pass backend;
}
server {
listen 127.0.0.1:53 udp reuseport;
proxy_timeout 20s;
proxy_pass dns;
}
server {
listen [::1]:12345;
proxy_pass unix:/tmp/stream.socket;
}
}
推荐阅读
-
Centos7通过yum跟源码编译安装Nginx
-
Linux下yum安装nginx教程
-
yum 安装memcache permission denied(拒绝访问) 问题
-
centos7利用yum安装lnmp的教程(linux+nginx+php7.1+mysql5.7)
-
CentOS7系统下用YUM安装Nginx详解
-
CentOS 7中利用yum安装Nginx的方法教程
-
关于安装linux redhat后无法使用yum命令安装gcc-c++问题的解决过程
-
解决yum安装报错Protected multilib versions的问题
-
centos直接yum安装nginx
-
centos直接yum安装nginx