0
我对https://github.com/coryhouse/react-slingshot有反应的应用程序库。 我有网址:/关于 如果我直接通过开发模式或本地主机上的生产直接到这个网址它工作正常。通过nginx的 但在EC2实例我有错误:ReactJS应用程序EC2路由器404
404 Not Found
nginx/1.10.3 (Ubuntu)
这里是我的nginx的conf:
server {
listen 80;
server_name example.com;
return 301 https://$server_name$request_uri;
}
server {
listen 443 ssl;
root /home/ubuntu/www/example;
index index.html index.htm;
add_header Strict-Transport-Security "max-age=31536000";
ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;
ssl_ciphers 'EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH:AES256+ECDHE';
# Make site accessible from http://localhost/
server_name example.com;
location/{
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ =404;
# Uncomment to enable naxsi on this location
# include /etc/nginx/naxsi.rules
}
}
如何正确配置呢?谢谢!