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
}
}
如何正確配置呢?謝謝!