-
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
25 additions
and
12 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,27 +1,40 @@ | ||
upstream nuxt_app { | ||
server app:3000; # 'app' es el nombre del contenedor Nuxt | ||
} | ||
|
||
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 | ||
|
||
# Directorio de los archivos estáticos generados por Nuxt | ||
root /app/.output/public; | ||
# root /app/.output/public; | ||
|
||
# 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 | ||
} | ||
# # 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 | ||
# } | ||
|
||
location / { | ||
proxy_pass http://localhost:3000; # Aquí hacemos el proxy hacia el puerto 3000 dentro del contenedor | ||
proxy_pass http://nuxt_app; | ||
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; | ||
} | ||
|
||
# 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; | ||
# } | ||
} |