nginx 配置

server {
    listen  80;
    server_name  www.swoole.com;
    root  /data/wwwroot/www.swoole.com;

    location / {
        if (!-e $request_filename){
            proxy_pass http://127.0.0.1:9501;
        }
    }
}

 9501就是swoole服务器监听的地址。root设置为静态文件的目录。当请求静态文件是由Nginx直接处理,当请求的文件不存在时,发送给Swoole服务器,来进行处理。

 

相关文章:

  • 2021-08-15
  • 2021-11-08
  • 2022-01-10
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-09
猜你喜欢
  • 2022-12-23
  • 2020-10-20
  • 2021-06-29
  • 2021-05-16
  • 2021-06-22
  • 2021-12-12
  • 2022-01-23
相关资源
相似解决方案