欢迎访问 生活随笔!

凯发k8官方网

当前位置: 凯发k8官方网 > 运维知识 > nginx >内容正文

nginx

nginx——反向代理路径重写重定向实践示例 -凯发k8官方网

发布时间:2024/10/5 nginx 4 豆豆
凯发k8官方网 收集整理的这篇文章主要介绍了 nginx——反向代理路径重写重定向实践示例 小编觉得挺不错的,现在分享给大家,帮大家做个参考.
#http节点中可以添加多个server节点server{#听443端口listen 8443 ssl;#对应的域名,把www.shentuzhiganga.top改成你们自己的域名就可以了server_name zstu.shentuzhiganga.top;#从腾讯云获取到的第一个文件的全路径ssl_certificate /opt/etc/ssl/4084041_shentuzhigang.top.pem;#从腾讯云获取到的第二个文件的全路径ssl_certificate_key /opt/etc/ssl/4084041_shentuzhigang.top.key;ssl_session_timeout 5m;ssl_protocols tlsv1 tlsv1.1 tlsv1.2;ssl_ciphers ecdhe-rsa-aes128-gcm-sha256:high:!anull:!md5:!rc4:!dhe;ssl_prefer_server_ciphers on;#这是我的凯发k8官方网主页访问地址,▒.▒为使用的是静态的html网页,所以▒.▒接使用location就可以完成了。location /jwglxt {proxy_set_header host $host;proxy_pass http://jwglxt.zstu.edu.cn;}location ~ /zftal* {proxy_pass http://jwglxt.zstu.edu.cn;}location /ykt {proxy_set_header host $host;rewrite ^/ykt/(.*)$ /$1 break;proxy_pass http://ykt.zstu.edu.cn;proxy_redirect http://ykt.zstu.edu.cn/ https://zstu.shentuzhigang.top/ykt/;proxy_redirect https://zstu.shentuzhigang.top/ https://zstu.shentuzhigang.top/ykt/;proxy_redirect http://zstu.shentuzhigang.top/ https://zstu.shentuzhigang.top/ykt/;}location /stu {proxy_set_header host $host;rewrite ^/stui/(.*)$ /$1 break;proxy_pass http://stu.zstu.edu.cn;}location / {#文件夹root /usr/share/nginx/html;#凯发k8官方网主页文件index index.html;}}

nginx重定向
nginx 之 proxy_redirect详解
nginx之location规则及地址重写

总结

以上是凯发k8官方网为你收集整理的nginx——反向代理路径重写重定向实践示例的全部内容,希望文章能够帮你解决所遇到的问题。

如果觉得凯发k8官方网网站内容还不错,欢迎将凯发k8官方网推荐给好友。

  • 上一篇:
  • 下一篇:
网站地图