首页 / NGINX / opensuse安装nginx
opensuse安装nginx
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了opensuse安装nginx,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含1520字,纯文字阅读大概需要3分钟。
内容图文
opensuse安装nginx
安装步骤如下
1、sudo zypper install curl ca-certificates gpg2
2、sudo zypper addrepo --gpgcheck --type yum --refresh --check 'http://nginx.org/packages/sles/$releasever' nginx-stable
3、sudo zypper addrepo --gpgcheck --type yum --refresh --check 'http://nginx.org/packages/mainline/sles/$releasever' nginx-mainline
4、curl -o /tmp/nginx_signing.key https://nginx.org/keys/nginx_signing.key
5、gpg --with-fingerprint /tmp/nginx_signing.key
6、pub 2048R/7BD9BF62 2011-08-19 [expires: 2024-06-14] Key fingerprint = 573B FD6B 3D8F BC64 1079 A6AB ABF5 BD82 7BD9 BF62 uid nginx signing key <signing-key@nginx.com>
7、sudo rpmkeys --import /tmp/nginx_signing.key
9、sudo zypper install nginx
配置nginx.conf,配置文件路径 /etc/nginx/nginx.conf
server {
# 监听80端口
listen 80;
# 服务器前端地址
server_name 255.255.255.0;
# 配置根地址:即访问ip地址,默认端口为80,映射到前端项目入口index.html
location / {
# 前端项目路径
root /home/vue/dist/;
# 前端项目入口
index index.html index.htm;
}
# 后端服务配置:地址是ip/vue映射到:localhost:8080
location /vue/ {
proxy_redirect off;
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:8080/;
}
}
nginx安装路径:/usr/local/nginx/sbin/nginx
启动命令路径:/usr/sbin/naginx
启动:/usr/sbin/nginx
停止:/usr/sbin/nginx -s stop
重新加载:/usr/sbin/nginx -s reload
内容总结
以上是互联网集市为您收集整理的opensuse安装nginx全部内容,希望文章能够帮你解决opensuse安装nginx所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。