[已解决]使用nginx做反向代理时,重启nginx报错

Madman

问题描述

使用nginx做反向代理时,重启nginx报错

程序代码

sportsManage.conf 文件

upstream webman {
    server 127.0.0.1:8787;
    keepalive 10240;
}

server {
  listen 100;
  access_log off;
  root /Users/wms/sportsManage/public

  location ^~ / {
      proxy_set_header X-Real-IP $remote_addr;
      proxy_set_header Host $http_host;
      proxy_set_header X-Forwarded-Proto $scheme;
      proxy_http_version 1.1;
      proxy_set_header Connection "";
      if (!-f $request_filename){
          proxy_pass http://webman;
      }
  }
}

报错信息

nginx: [emerg] directive "root" is not terminated by ";" in /usr/local/etc/nginx/servers/sportsManage.conf:11

截图

781 1 0
1个回答

北月

root那行结尾少了个分号

  • Madman 2024-02-03

    谢谢 一直在找11行的问题。。。

×
🔝