Nginx config
Configuration
Serve React
Note:
- Solve browser route 404:[1]
server {
root /var/www/html;
server_name yai.ink;
location / {
try_files $uri $uri/ /index.html;
}
}
Reverse proxy
Note: be careful that the backend should also use correct config.
server {
index index.html index.htm index.nginx-debian.html;
server_name yai.ink;
location / {
proxy_pass http://localhost:8000;
}
}