2025年3月14日 星期五 甲辰(龙)年 月十三 设为首页 加入收藏
rss
您当前的位置:首页 > 计算机 > 服务器 > Nginx

nginx 配置代理

时间:12-14来源:作者:点击数:12
城东书院 www.cdsy.xyz

nginx 配置代理

正向代理(代理的客户端)

  • server {
  • list 80;
  • server_name www.qq.com;
  • location / {
  • proxy_pass http://$http_host$request_uri;
  • }
  • error_page 500 502 503 504 /50x.html;
  • location = /50x.html {
  • root /sur/share/nginx/html;
  • }
  • }

反向代理(代理的服务器)

  • server {
  • location ~ ^/api {
  • proxy_pass http://localhost:3000;
  • }
  • }
城东书院 www.cdsy.xyz
方便获取更多学习、工作、生活信息请关注本站微信公众号城东书院 微信服务号城东书院 微信订阅号
推荐内容
相关内容
栏目更新
栏目热门
本栏推荐