我目前正在Docker容器中的NGINX上使用此配置文件。主页工作正常,但所有其他React路由均不起作用。请帮助大家!
# user wlopez wlopez; # worker_processes 4; upstream expressCluster { server express; } # Express server { listen ${NGINX_PORT}; location / { proxy_pass http://expressCluster; proxy_redirect off; } server_name api.${NGINX_DOMAIN}; } # ReactJS server { listen ${NGINX_PORT}; location / { root /etc/nginx/html; try_files $uri $uri/ /index.html; } server_name www.${NGINX_DOMAIN}; }