nginx 代理服务

 

nginx.conf

worker_processes  1;

events {
  worker_connections  1024;
}

http {
  server {
    listen 8080;
    root /data/up1;
    location / {
    }
  }
  server {
    location / {
      proxy_pass http://localhost:8080;
    }
    location /www {
      root /data;
    }
    location /images/ {
      root /data;
    }
    location ~ \.(gif|jpg|png)$ {
      root /data/images;
    }
  }
}

  

重新载入配置文件: 
/usr/local/nginx/sbin/nginx -s reload            # 重新载入配置文件

   

访问:

http://loc168/
http://loc168/images/estunLogo.png ×
http://loc168/estunLogo.png
http://loc168/www/

   

创建资源:

 

posted @ 2023-07-28 11:46  草木物语  阅读(6)  评论(0编辑  收藏  举报