server { listen 8112; server_name _; # 匹配所有主机名 location / { root /MicroCommunityIotWeb; } location /iot/api { add_header 'Access-Control-Allow-Origin' '*'; proxy_pass http://micro-community-iot:9999; } location /app { add_header 'Access-Control-Allow-Origin' '*'; proxy_pass http://micro-community-iot:9999; } location /ws { proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; proxy_pass http://micro-community-iot:9999; } }