当前位置: 首页 > news >正文

青海西宁网站开发公司b站视频推广网站动漫

青海西宁网站开发公司,b站视频推广网站动漫,合肥市建设委员会网站,大学生做网站和做appCentOS rpm安装Nginx和配置 官方下载地址: http://nginx.org/en/download.html 介绍 Nginx(“engine x”)是一款由俄罗斯的程序设计师Igor Sysoev所开发高性能的 Web和 反向代理 服务器,也是一个 IMAP/POP3/SMTP 代理服务器。 rpm包安装 #安装nginx&#xff0c…

CentOS rpm安装Nginx和配置

官方下载地址: http://nginx.org/en/download.html

介绍

Nginx(“engine x”)是一款由俄罗斯的程序设计师Igor Sysoev所开发高性能的 Web和 反向代理 服务器,也是一个 IMAP/POP3/SMTP 代理服务器。

rpm包安装

#安装nginx,rpm安装
#rpm安装nginx包
rpm -Uvh --force --nodeps nginx-1.16.1-1.el7.ngx.x86_64.rpm#查看启动状态
systemctl status nginx显示如下:
● nginx.service - nginx - high performance web serverLoaded: loaded (/usr/lib/systemd/system/nginx.service; enabled; vendor preset: disabled)Active: active (running) since 五 2021-11-26 11:12:41 CST; 5 days agoDocs: http://nginx.org/en/docs/Process: 1379 ExecStart=/usr/sbin/nginx -c /etc/nginx/nginx.conf (code=exited, status=0/SUCCESS)Main PID: 1543 (nginx)Tasks: 5CGroup: /system.slice/nginx.service├─1543 nginx: master process /usr/sbin/nginx -c /etc/nginx/nginx.conf├─1544 nginx: worker process├─1546 nginx: worker process├─1547 nginx: worker process└─1548 nginx: worker process1126 11:12:41 liang systemd[1]: Starting nginx - high performance web server...
1126 11:12:41 liang systemd[1]: Started nginx - high performance web server.#启动
systemctl start nginx#重启
systemctl restart nginx#开机自启动服务
systemctl enable nginx#查看开机启动状态 enabled:开启, disabled:关闭
systemctl is-enabled nginx

安装完后在 修改 /etc/nginx/conf.d/default.conf 配置文件,参考内容如下:

vim /etc/nginx/conf.d/default.conf

server {listen       80;server_name  localhost;#charset koi8-r;#access_log  /var/log/nginx/host.access.log  main;location /ui {alias   /data/dist;index  index.html index.htm;}location /file/ {root   /home/data/;index  index.html index.htm;}    # websocket配置wsslocation /liangws/ {proxy_pass http://192.168.0.19:8080/;proxy_http_version 1.1;proxy_set_header Upgrade $http_upgrade;proxy_set_header Connection "upgrade";proxy_set_header Remote_addr $remote_addr;proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;proxy_read_timeout 600s;}location ~ /gat {proxy_set_header Host  $host;proxy_set_header X-Real-IP $remote_addr;proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;proxy_pass http://localhost:18080 ;}#error_page  404              /404.html;# redirect server error pages to the static page /50x.html#error_page   500 502 503 504  /50x.html;location = /50x.html {root   /usr/share/nginx/html;}# proxy the PHP scripts to Apache listening on 127.0.0.1:80##location ~ \.php$ {#    proxy_pass   http://127.0.0.1;#}# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000##location ~ \.php$ {#    root           html;#    fastcgi_pass   127.0.0.1:9000;#    fastcgi_index  index.php;#    fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;#    include        fastcgi_params;#}# deny access to .htaccess files, if Apache's document root# concurs with nginx's one##location ~ /\.ht {#    deny  all;#}
}

注意:静态文件下载,需要依赖nginx,我们需要将这些文件放到 nginx配置文件中的 /home/data/aaa 对应的目录下。

启动服务配置

cat /usr/lib/systemd/system/nginx.service

[Unit]
Description=nginx - high performance web server
Documentation=http://nginx.org/en/docs/
After=network-online.target remote-fs.target nss-lookup.target
Wants=network-online.target[Service]
Type=forking
PIDFile=/var/run/nginx.pid
ExecStart=/usr/sbin/nginx -c /etc/nginx/nginx.conf
ExecReload=/bin/kill -s HUP $MAINPID
ExecStop=/bin/kill -s TERM $MAINPID[Install]
WantedBy=multi-user.target
http://www.dinnco.com/news/47173.html

相关文章:

  • 做营销网站设计seo线下培训班
  • 那个企业网站是用vue做的南京seo公司教程
  • 网站开发英文怎么说seo百度关键词排名
  • 路由器做网站教程外贸企业网站制作哪家好
  • 西宁高端网站建设宁德市有几个区几个县
  • 协会工作方案网站建设困难网站设计的毕业论文
  • dremwear做网站成都百度百科
  • 中企动力做的网站怎么登陆seo教程技术优化搜索引擎
  • 酒店网站搜索引擎优化方案厦门关键词优化平台
  • 视频网站VIP卡怎么做赠品百度网盘怎么用
  • 网站怎么做显得简洁美观谷歌推广app
  • 电子商务设计网站建设seo是什么意思啊
  • wordpress 广告插件汉化版seo标签优化
  • 万网域名查询注册商想做seo哪里有培训的
  • 凡科建站有哪些弊端怎么做网络宣传推广
  • 郑州网站优化排名推广湖南网站营销seo方案
  • 用ps做网站画布一般建多大十堰seo优化方法
  • 网站建设进度控制seo是什么车
  • 开设一个网站的费用浏览器下载安装2023版本
  • 世界500强中国有几个佛山百度快速排名优化
  • 新手做网站什么内容比较好世界最新新闻
  • 实验一html静态网站开发深圳市昊客网络科技有限公司
  • 焦作网站建设哪家专业windows优化大师下载安装
  • 哪个网站做视频有钱挣日本疫情最新数据
  • 太原网站建设 网站制作google搜索引擎下载
  • 公司网站文化活动备案百度用户服务中心官网
  • c 网站开发程序员长尾关键词挖掘熊猫
  • 免费可以做旅游海报 的网站管理培训班
  • 合肥建网站公司地址怎么制作网站平台
  • 全国广告公司网站建设百度人工客服电话24小时