| 
									
										
										
										
											2025-09-03 14:16:18 -03:00
										 |  |  | server { | 
					
						
							|  |  |  |     listen 80; | 
					
						
							|  |  |  |     server_name localhost; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     root /usr/share/nginx/html; | 
					
						
							|  |  |  |     index index.html; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-09-03 15:31:25 -03:00
										 |  |  |     # Bloque para activos estáticos (manifest.json, js, css, etc.) | 
					
						
							| 
									
										
										
										
											2025-09-03 14:55:19 -03:00
										 |  |  |     location ~* \.(?:manifest\.json|js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2)$ { | 
					
						
							| 
									
										
										
										
											2025-09-03 15:31:25 -03:00
										 |  |  |         # Si no encuentra el archivo, devuelve un error 404. ¡No el index.html! | 
					
						
							| 
									
										
										
										
											2025-09-03 14:55:19 -03:00
										 |  |  |         try_files $uri =404; | 
					
						
							|  |  |  |          | 
					
						
							| 
									
										
										
										
											2025-09-03 14:30:20 -03:00
										 |  |  |         expires 1y; | 
					
						
							|  |  |  |         add_header Cache-Control "public"; | 
					
						
							|  |  |  |     } | 
					
						
							| 
									
										
										
										
											2025-09-03 14:55:19 -03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-09-03 15:31:25 -03:00
										 |  |  |     # Bloque para las rutas de la aplicación de React | 
					
						
							| 
									
										
										
										
											2025-09-03 14:55:19 -03:00
										 |  |  |     location / { | 
					
						
							|  |  |  |         try_files $uri $uri/ /index.html; | 
					
						
							|  |  |  |     } | 
					
						
							| 
									
										
										
										
											2025-09-03 14:16:18 -03:00
										 |  |  | } |