-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
21 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,40 @@ | ||
server { | ||
listen 80; # Nginx escucha en el puerto 80, expuesto al host | ||
|
||
server_name test2.openebench.bsc.es; # O puedes especificar tu dominio si es necesario | ||
#server_name test2.openebench.bsc.es; # O puedes especificar tu dominio si es necesario | ||
|
||
|
||
server_name localhost; | ||
|
||
# Directorio de los archivos estáticos generados por Nuxt | ||
root /app/.output/public; | ||
|
||
# # Servir archivos estáticos (JS, CSS, imágenes, etc.) | ||
# Servir archivos estáticos (JS, CSS, imágenes, etc.) | ||
location /_nuxt/ { | ||
try_files $uri $uri/ =404; # Asegura que los archivos estáticos se sirvan correctamente | ||
} | ||
|
||
# Rutas dinámicas (API - Proxy a Nuxt backend) | ||
location /api/ { | ||
proxy_pass http://localhost:3000; # Redirige las solicitudes de la API al servidor Nuxt | ||
proxy_http_version 1.1; | ||
proxy_set_header Upgrade $http_upgrade; | ||
proxy_set_header Connection 'upgrade'; | ||
proxy_set_header Host $host; | ||
proxy_cache_bypass $http_upgrade; | ||
} | ||
|
||
# location / { | ||
# proxy_pass http://localhost:3000; | ||
# proxy_pass http://localhost:3000; # Aquí hacemos el proxy hacia el puerto 3000 dentro del contenedor | ||
# proxy_http_version 1.1; | ||
# proxy_set_header Upgrade $http_upgrade; | ||
# proxy_set_header Connection 'upgrade'; | ||
# proxy_set_header Host $host; | ||
# proxy_cache_bypass $http_upgrade; | ||
# } | ||
|
||
location / { | ||
proxy_pass http://localhost:3000; # Aquí hacemos el proxy hacia el puerto 3000 dentro del contenedor | ||
proxy_http_version 1.1; | ||
proxy_set_header Upgrade $http_upgrade; | ||
proxy_set_header Connection 'upgrade'; | ||
proxy_set_header Host $host; | ||
proxy_cache_bypass $http_upgrade; | ||
|
||
# Para asegurar que la aplicación Nuxt se ejecute correctamente | ||
proxy_set_header X-Real-IP $remote_addr; | ||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
proxy_set_header X-Forwarded-Proto $scheme; | ||
} | ||
# # Para asegurar que la aplicación Nuxt se ejecute correctamente | ||
# proxy_set_header X-Real-IP $remote_addr; | ||
# proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
# proxy_set_header X-Forwarded-Proto $scheme; | ||
# } | ||
} |