링크 ux 아래 nginx 설치, 조작, 설정, 문제 및 해결
3253 단어 nginx
----------------------------------------------- --------------------------------------------------------
yum -y install gcc pcre-devel zlib-devel openssl openssl-devel
nginx :https://nginx.org/download/
--
tar -zxvf nginx-1.9.9.tar.gz tar -zxvf nginx-1.9.9.tar.gz -C /home/nginx
-- nginx
cd nginx-1.9.9
--
./configure --prefix=/usr/local/nginx
--make
make
make install
-- /usr/local/nginx
./sbin/nginx -t
--- ( )
-- 80 :
firewall-cmd --add-port=80/tcp --permanent
#
systemctl restart firewalld
-- nginx
vim /etc/rc.d/rc.local
/usr/local/nginx/sbin/nginx
----------------------------------------------nginx ---------------------------------------------------
nginx
-- Nginx:./nginx -s stop
-- Nginx:./nginx -s quit
-- :nginx -s reload
------------------------------- nginx ( nginx)-----------------------------------------
-- nginx
service nginx stop
-- nginx
chkconfig nginx off
-- Nginx (whereis nginx)
rm -rf /usr/sbin/nginx
rm -rf /etc/nginx
rm -rf /etc/init.d/nginx
-- yum
yum remove nginx
---------------------------------------conf --------------------------------------------------------
nginx conf/nginx.conf
--
#test1 ,hash
upstream test1sss {
server localhost:8090; # tomcat1( )
}
#test2
upstream test2sss {
server localhost:8091; # tomcat2( )
}
server {
# 80
listen 80;
server_name www.pytest1.xxx.com pytest1.xxx.com;
access_log on;
#charset koi8-r;
charset utf-8;
#
autoindex on;
#access_log logs/host.access.log main;
location /test1 {
proxy_pass http://test1sss/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
#
location /test2 {
proxy_pass http://test2sss/;
proxy_set_header Host $host;
proxy_connect_timeout 5s;
}
location / {
root html;
index index.html index.htm;
}
# /home/dist1
location /dist1 {
alias /home/dist1/;
index index.html index.htm;
}
# /home/dist2/dist2
location /dist2 {
root /home/dist2/;
index index.html index.htm;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
-----
upstream backend {
server backend1.example.com weight=5;
server backend2.example.com:8080;
server unix:/tmp/backend3;
server backup1.example.com:8080 backup;
server backup2.example.com:8080 backup;
}
------------------------------logs nginx pid -------------------------------------------
nginx logs pid
ps -ef | grep nginx
-- logs
touch nginx.pid
--
echo "34222" > nginx.pid
-- :
./nginx -s reload
docker 에 nginx 를 설치 하 는 것 은 개인 적 으로 귀 찮 기 때문에 일반적인 상황 에서 설치 패 키 지 를 미리 다운로드 하여 Liux 에 직접 설치 하 는 방식 을 선택 합 니 다. 글 은 참고 만 하고 구체 적 인 설치 방식 도 구체 적 인 상황 에 따라 정할 수 있 습 니 다.
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
간단! Certbot을 사용하여 웹 사이트를 SSL(HTTPS)화하는 방법초보자가 인프라 주위를 정돈하는 것은 매우 어렵습니다. 이번은 사이트를 간단하게 SSL화(HTTP에서 HTTPS통신)로 변경하는 방법을 소개합니다! 이번에는 소프트웨어 시스템 Nginx CentOS7 의 환경에서 S...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.