济宁网站定制公司备案的网站做跳转不影响备案把
web/
2025/9/29 8:15:58/
文章来源:
济宁网站定制公司,备案的网站做跳转不影响备案把,美化网站公司,wordpress评论随机目录
一、nginx是什么#xff1f;
二、安装部署
1.下载
2.配置
3.代理Swagger服务
4.nginx命令 一、nginx是什么#xff1f;
是用于 Web 服务、反向代理、内容缓存、负载均衡、媒体流传输等场景的开源软件。它最初是一款专为实现最高性能和稳定性而设计的 Web 服务器。…目录
一、nginx是什么
二、安装部署
1.下载
2.配置
3.代理Swagger服务
4.nginx命令 一、nginx是什么
是用于 Web 服务、反向代理、内容缓存、负载均衡、媒体流传输等场景的开源软件。它最初是一款专为实现最高性能和稳定性而设计的 Web 服务器。除了 HTTP 服务器功能以外NGINX 还可用作电子邮件IMAP、POP3 和 SMTP的代理服务器以及 HTTP、TCP 和 UDP 服务器的反向代理与负载均衡器。
二、安装部署
1.下载
下载地址 https://nginx.org/en/download.html 2.配置
解压后打开nginx.conf server {listen 8005; #服务器端口server_name localhost; #服务器地址#charset koi8-r;#access_log logs/host.access.log main;location /{root html; index index.html index.htm;}}
启动nginx服务看到此页面说明搭建完成 3.代理Swagger服务
例如swagger地址http://localhost:5005/index.html
在nginx.conf文件下的server节点下
server {listen 8005; #服务器端口server_name localhost; #服务器地址#charset koi8-r;#access_log logs/host.access.log main;location /{root G:\T5\Web\dist; #前端打包后的文件地址index index.html index.htm;}location /api{proxy_pass http://localhost:5005; #Swagger代理地址proxy_set_header Upgrade $http_upgrade;proxy_set_header Connection keep-alive;proxy_set_header Host $host;proxy_set_header X-Forwarded-Proto $scheme;proxy_set_header X-Forwarded-Host $host;proxy_set_header X-Forwarded-Port $server_port;proxy_cache_bypass $http_upgrade;proxy_set_header X-Forwarded-Prefix oaapi; proxy_set_header X-Real-IP $remote_addr;proxy_set_header X-Forwarded-For $remote_addr;}
} 再次重启nginx服务即可
4.nginx命令
nginx -s reopen #重启Nginxnginx -s reload #重新加载Nginx配置文件然后以优雅的方式重启Nginxnginx -s stop #强制停止Nginx服务nginx -s quit #优雅地停止Nginx服务即处理完所有请求后再停止服务nginx -t #检测配置文件是否有语法错误然后退出nginx -?,-h #打开帮助信息nginx -v #显示版本信息并退出nginx -V #显示版本和配置选项信息然后退出nginx -t #检测配置文件是否有语法错误然后退出nginx -T #检测配置文件是否有语法错误转储并退出nginx -q #在检测配置文件期间屏蔽非错误信息nginx -p prefix #设置前缀路径(默认是:/usr/share/nginx/)nginx -c filename #设置配置文件(默认是:/etc/nginx/nginx.conf)nginx -g directives #设置配置文件外的全局指令killall nginx #杀死所有nginx进程
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/web/83794.shtml
如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!