- Correction vhosts port 3000: écoute sur 0.0.0.0:3000 et [::]:3000 - Harmonisation directives listen IPv6 pour éviter duplicate options - Configuration Nginx pour accès externe sur port 3000 - Support authentification ID.not via /authorized-client
338 lines
10 KiB
Plaintext
338 lines
10 KiB
Plaintext
# HTTP server for ACME and initial proxying
|
|
# HTTP server for ACME and initial proxying
|
|
server {
|
|
server {
|
|
listen 80;
|
|
listen 80;
|
|
server_name dev4.4nkweb.com;
|
|
server_name dev4.4nkweb.com;
|
|
|
|
|
|
# ACME HTTP-01 challenges
|
|
# ACME HTTP-01 challenges
|
|
location /.well-known/acme-challenge/ {
|
|
location /.well-known/acme-challenge/ {
|
|
root /var/www/letsencrypt;
|
|
root /var/www/letsencrypt;
|
|
}
|
|
}
|
|
|
|
|
|
# ihm_client (root)
|
|
# ihm_client (root)
|
|
location / {
|
|
location / {
|
|
proxy_pass http://127.0.0.1:3003;
|
|
proxy_pass http://127.0.0.1:3003;
|
|
include /etc/nginx/proxy_params;
|
|
include /etc/nginx/proxy_params;
|
|
proxy_http_version 1.1;
|
|
proxy_http_version 1.1;
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
proxy_set_header Connection "upgrade";
|
|
proxy_set_header Connection "upgrade";
|
|
proxy_read_timeout 300;
|
|
proxy_read_timeout 300;
|
|
}
|
|
}
|
|
|
|
|
|
# Favicon (global)
|
|
# Favicon (global)
|
|
location = /favicon.ico {
|
|
location = /favicon.ico {
|
|
root /home/debian/lecoffre_node/conf/nginx/assets;
|
|
root /home/debian/lecoffre_node/conf/nginx/assets;
|
|
try_files /favicon.ico =404;
|
|
try_files /favicon.ico =404;
|
|
access_log off;
|
|
access_log off;
|
|
expires 30d;
|
|
expires 30d;
|
|
}
|
|
}
|
|
|
|
|
|
# lecoffre-front
|
|
# lecoffre-front
|
|
location = /lecoffre {
|
|
location = /lecoffre {
|
|
proxy_pass http://127.0.0.2:3004/lecoffre;
|
|
proxy_pass http://127.0.0.2:3004/lecoffre;
|
|
include /etc/nginx/proxy_params;
|
|
include /etc/nginx/proxy_params;
|
|
proxy_set_header Host $host;
|
|
proxy_set_header Host $host;
|
|
proxy_set_header X-Forwarded-Proto http;
|
|
proxy_set_header X-Forwarded-Proto http;
|
|
proxy_set_header X-Forwarded-Host $host;
|
|
proxy_set_header X-Forwarded-Host $host;
|
|
proxy_set_header X-Forwarded-Prefix /lecoffre;
|
|
proxy_set_header X-Forwarded-Prefix /lecoffre;
|
|
proxy_read_timeout 300;
|
|
proxy_read_timeout 300;
|
|
}
|
|
}
|
|
location /lecoffre/ {
|
|
location /lecoffre/ {
|
|
proxy_pass http://127.0.0.2:3004;
|
|
proxy_pass http://127.0.0.2:3004;
|
|
include /etc/nginx/proxy_params;
|
|
include /etc/nginx/proxy_params;
|
|
proxy_set_header Host $host;
|
|
proxy_set_header Host $host;
|
|
proxy_set_header X-Forwarded-Proto http;
|
|
proxy_set_header X-Forwarded-Proto http;
|
|
proxy_set_header X-Forwarded-Host $host;
|
|
proxy_set_header X-Forwarded-Host $host;
|
|
proxy_set_header X-Forwarded-Prefix /lecoffre;
|
|
proxy_set_header X-Forwarded-Prefix /lecoffre;
|
|
proxy_read_timeout 300;
|
|
proxy_read_timeout 300;
|
|
}
|
|
}
|
|
|
|
|
|
# Next.js assets and HMR under basePath
|
|
# Next.js assets and HMR under basePath
|
|
location /lecoffre/_next/webpack-hmr {
|
|
location /lecoffre/_next/webpack-hmr {
|
|
proxy_http_version 1.1;
|
|
proxy_http_version 1.1;
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
proxy_set_header Connection "upgrade";
|
|
proxy_set_header Connection "upgrade";
|
|
proxy_set_header Host $host;
|
|
proxy_set_header Host $host;
|
|
proxy_set_header X-Forwarded-Proto http;
|
|
proxy_set_header X-Forwarded-Proto http;
|
|
proxy_buffering off;
|
|
proxy_buffering off;
|
|
proxy_pass http://127.0.0.2:3004/lecoffre/_next/webpack-hmr;
|
|
proxy_pass http://127.0.0.2:3004/lecoffre/_next/webpack-hmr;
|
|
proxy_read_timeout 600s;
|
|
proxy_read_timeout 600s;
|
|
}
|
|
}
|
|
|
|
|
|
location /lecoffre/_next/ {
|
|
location /lecoffre/_next/ {
|
|
proxy_pass http://127.0.0.2:3004/lecoffre/_next/;
|
|
proxy_pass http://127.0.0.2:3004/lecoffre/_next/;
|
|
include /etc/nginx/proxy_params;
|
|
include /etc/nginx/proxy_params;
|
|
proxy_read_timeout 300;
|
|
proxy_read_timeout 300;
|
|
}
|
|
}
|
|
|
|
|
|
# Favicon sous /lecoffre
|
|
# Favicon sous /lecoffre
|
|
location = /lecoffre/favicon.ico {
|
|
location = /lecoffre/favicon.ico {
|
|
root /home/debian/lecoffre_node/conf/nginx/assets;
|
|
root /home/debian/lecoffre_node/conf/nginx/assets;
|
|
try_files /favicon.ico =404;
|
|
try_files /favicon.ico =404;
|
|
access_log off;
|
|
access_log off;
|
|
expires 30d;
|
|
expires 30d;
|
|
}
|
|
}
|
|
|
|
|
|
# Next.js assets (served at root by the app)
|
|
# Next.js assets (served at root by the app)
|
|
location /_next/ {
|
|
location /_next/ {
|
|
proxy_pass http://127.0.0.2:3004/_next/;
|
|
proxy_pass http://127.0.0.2:3004/_next/;
|
|
include /etc/nginx/proxy_params;
|
|
include /etc/nginx/proxy_params;
|
|
proxy_read_timeout 300;
|
|
proxy_read_timeout 300;
|
|
}
|
|
}
|
|
|
|
|
|
# API backend
|
|
# API backend
|
|
location /back/ {
|
|
rewrite ^\/back\/(.*)$ \/api\/\1 break;
|
|
proxy_pass http:\/\/127.0.0.1:8080;
|
|
location /back/ {
|
|
location /back/ {
|
|
rewrite ^\/back\/(.*)$ \/api\/\1 break;
|
|
proxy_pass http:\/\/127.0.0.1:8080;
|
|
location /back/ {
|
|
proxy_pass http://127.0.0.1:8080/back/;
|
|
proxy_http_version 1.1;
|
|
proxy_http_version 1.1;
|
|
proxy_set_header Host $host;
|
|
proxy_set_header Host $host;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
proxy_set_header X-Forwarded-Proto $scheme;
|
|
proxy_set_header X-Forwarded-Proto $scheme;
|
|
proxy_set_header Connection "";
|
|
proxy_set_header Connection "";
|
|
proxy_buffering off;
|
|
proxy_buffering off;
|
|
}
|
|
}
|
|
|
|
|
|
# API alias → même backend que /back
|
|
# API alias → même backend que /back
|
|
location /api/ {
|
|
location /api/ {
|
|
proxy_pass http://127.0.0.1:8080/;
|
|
proxy_pass http://127.0.0.1:8080/;
|
|
include /etc/nginx/proxy_params;
|
|
include /etc/nginx/proxy_params;
|
|
proxy_read_timeout 300;
|
|
proxy_read_timeout 300;
|
|
}
|
|
}
|
|
|
|
|
|
# blindbit
|
|
# blindbit
|
|
location /blindbit/ {
|
|
location /blindbit/ {
|
|
proxy_pass http://127.0.0.1:8000/;
|
|
proxy_pass http://127.0.0.1:8000/;
|
|
include /etc/nginx/proxy_params;
|
|
include /etc/nginx/proxy_params;
|
|
proxy_read_timeout 300;
|
|
proxy_read_timeout 300;
|
|
}
|
|
}
|
|
|
|
|
|
# signer (sdk_signer) avec support WebSocket
|
|
# signer (sdk_signer) avec support WebSocket
|
|
location /signer/ {
|
|
location /signer/ {
|
|
proxy_http_version 1.1;
|
|
proxy_http_version 1.1;
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
proxy_set_header Connection "upgrade";
|
|
proxy_set_header Connection "upgrade";
|
|
proxy_set_header Host $host;
|
|
proxy_set_header Host $host;
|
|
proxy_set_header X-Forwarded-Proto http;
|
|
proxy_set_header X-Forwarded-Proto http;
|
|
proxy_pass http://127.0.0.1:3001/;
|
|
proxy_pass http://127.0.0.1:3001/;
|
|
proxy_read_timeout 600s;
|
|
proxy_read_timeout 600s;
|
|
proxy_buffering off;
|
|
proxy_buffering off;
|
|
}
|
|
}
|
|
|
|
|
|
# storage (sdk_storage)
|
|
# storage (sdk_storage)
|
|
location /storage/ {
|
|
location /storage/ {
|
|
proxy_pass http://127.0.0.1:8081/;
|
|
proxy_pass http://127.0.0.1:8081/;
|
|
include /etc/nginx/proxy_params;
|
|
include /etc/nginx/proxy_params;
|
|
proxy_read_timeout 300;
|
|
proxy_read_timeout 300;
|
|
}
|
|
}
|
|
|
|
|
|
# WebSocket relay on /ws → 8090
|
|
# WebSocket relay on /ws → 8090
|
|
location = /ws {
|
|
location = /ws {
|
|
proxy_http_version 1.1;
|
|
proxy_http_version 1.1;
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
proxy_set_header Connection "upgrade";
|
|
proxy_set_header Connection "upgrade";
|
|
proxy_set_header Host $host;
|
|
proxy_set_header Host $host;
|
|
proxy_set_header X-Forwarded-Proto http;
|
|
proxy_set_header X-Forwarded-Proto http;
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
proxy_buffering off;
|
|
proxy_buffering off;
|
|
proxy_pass http://127.0.0.1:8090/;
|
|
proxy_pass http://127.0.0.1:8090/;
|
|
proxy_read_timeout 600s;
|
|
proxy_read_timeout 600s;
|
|
}
|
|
}
|
|
|
|
|
|
location /ws/ {
|
|
location /ws/ {
|
|
proxy_http_version 1.1;
|
|
proxy_http_version 1.1;
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
proxy_set_header Connection "upgrade";
|
|
proxy_set_header Connection "upgrade";
|
|
proxy_set_header Host $host;
|
|
proxy_set_header Host $host;
|
|
proxy_set_header X-Forwarded-Proto http;
|
|
proxy_set_header X-Forwarded-Proto http;
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
proxy_buffering off;
|
|
proxy_buffering off;
|
|
# Strip /ws prefix when proxying to backend root
|
|
# Strip /ws prefix when proxying to backend root
|
|
proxy_pass http://127.0.0.1:8090/;
|
|
proxy_pass http://127.0.0.1:8090/;
|
|
proxy_read_timeout 600s;
|
|
proxy_read_timeout 600s;
|
|
}
|
|
}
|
|
|
|
|
|
# Next.js HMR websocket for lecoffre-front
|
|
# Next.js HMR websocket for lecoffre-front
|
|
location /_next/webpack-hmr {
|
|
location /_next/webpack-hmr {
|
|
proxy_http_version 1.1;
|
|
proxy_http_version 1.1;
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
proxy_set_header Connection "upgrade";
|
|
proxy_set_header Connection "upgrade";
|
|
proxy_set_header Host $host;
|
|
proxy_set_header Host $host;
|
|
proxy_set_header X-Forwarded-Proto http;
|
|
proxy_set_header X-Forwarded-Proto http;
|
|
proxy_buffering off;
|
|
proxy_buffering off;
|
|
proxy_pass http://127.0.0.2:3004/_next/webpack-hmr;
|
|
proxy_pass http://127.0.0.2:3004/_next/webpack-hmr;
|
|
proxy_read_timeout 300;
|
|
proxy_read_timeout 300;
|
|
}
|
|
}
|
|
}
|
|
}
|