server {
listen 8080;
# server_name your.domain.com;
root /home/root/react-demo/dist;
index index.html index.htm;
location / {
try_files $uri $uri/ /index.html;
}
location ^~ /assets/ {
gzip_static on;
expires max;
add_header Cache-Control public;
}
error_page 500 502 503 504 /500.html;
client_max_body_size 20M;
keepalive_timeout 10;
}
来源:oschina
链接:https://my.oschina.net/u/4344137/blog/3269950