我目前在我的Docker容器中的NGINX上使用此配置文件 . 主页工作正常,但所有其他React Routes都无法正常工作 . 请帮帮我们!
# 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};
}