2022-12-05 01:38:51 +01:00
|
|
|
upstream egommerce-api-gw {
|
2023-06-24 18:32:57 +02:00
|
|
|
server 127.0.0.1:40056;
|
2022-12-05 01:38:51 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
upstream egommerce-api-gw-dashboard {
|
2023-06-24 18:32:57 +02:00
|
|
|
server 127.0.0.1:40057;
|
2022-12-05 01:38:51 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
upstream egommerce-api-registry-ui {
|
2023-06-24 18:32:57 +02:00
|
|
|
server 127.0.0.1:40058;
|
2022-12-05 01:38:51 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
upstream egommerce-api-eventbus-mngmt {
|
2023-06-24 18:32:57 +02:00
|
|
|
server 127.0.0.1:40059;
|
2022-12-05 01:38:51 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
server {
|
2023-06-24 18:17:19 +02:00
|
|
|
listen [2a01:4f9:3a:2910::271]:20271 ssl;
|
|
|
|
ssl_certificate /home/keedosn/egommerce/deploy/certs/api-gateway/client.cert;
|
|
|
|
ssl_certificate_key /home/keedosn/egommerce/deploy/certs/api-gateway/client.key;
|
2022-12-05 01:38:51 +01:00
|
|
|
|
2023-06-24 18:17:19 +02:00
|
|
|
server_name keshop.bieda.it;
|
2022-12-05 01:38:51 +01:00
|
|
|
|
|
|
|
# Traefik redirects
|
2022-12-05 03:13:27 +01:00
|
|
|
location /dashboard {
|
|
|
|
if ($http_referer ~ (/gateway)) {
|
|
|
|
proxy_pass http://egommerce-api-gw-dashboard;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
location /api {
|
|
|
|
if ($http_referer ~ (/gateway)) {
|
|
|
|
proxy_pass http://egommerce-api-gw-dashboard;
|
|
|
|
}
|
|
|
|
}
|
2022-12-05 01:38:51 +01:00
|
|
|
|
2022-12-05 03:13:27 +01:00
|
|
|
location /gateway/ {
|
2022-12-05 01:38:51 +01:00
|
|
|
proxy_pass http://egommerce-api-gw-dashboard/dashboard/;
|
|
|
|
proxy_pass_header Server;
|
|
|
|
proxy_set_header Host $host;
|
|
|
|
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;
|
|
|
|
client_max_body_size 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
# Consul redirects
|
2022-12-05 03:13:27 +01:00
|
|
|
location /ui {
|
|
|
|
if ($http_referer ~ (/registry)) {
|
|
|
|
proxy_pass http://egommerce-api-registry-ui;
|
|
|
|
}
|
|
|
|
}
|
2022-12-05 01:38:51 +01:00
|
|
|
|
2022-12-05 03:13:27 +01:00
|
|
|
location /v1 {
|
|
|
|
if ($http_referer ~ (/registry)) {
|
|
|
|
proxy_pass http://egommerce-api-registry-ui;
|
|
|
|
}
|
|
|
|
}
|
2022-12-05 01:38:51 +01:00
|
|
|
|
2022-12-05 03:13:27 +01:00
|
|
|
location /registry {
|
|
|
|
proxy_pass http://egommerce-api-registry-ui;
|
2023-06-24 18:38:24 +02:00
|
|
|
proxy_http_version 1.1;
|
2022-12-05 01:38:51 +01:00
|
|
|
proxy_pass_header Server;
|
2022-12-05 03:13:27 +01:00
|
|
|
proxy_set_header Host $host;
|
|
|
|
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;
|
|
|
|
client_max_body_size 0;
|
|
|
|
}
|
2022-12-05 01:38:51 +01:00
|
|
|
|
|
|
|
|
|
|
|
# RabbitMQ Mngmt redirects
|
2022-12-05 03:13:27 +01:00
|
|
|
location /eventbus {
|
|
|
|
return 302 /eventbus/;
|
|
|
|
}
|
|
|
|
location ~* /eventbus/api/(.*?)/(.*) {
|
|
|
|
proxy_pass http://egommerce-api-eventbus-mngmt/api/$1/%2F/$2?$query_string;
|
2023-06-24 18:38:24 +02:00
|
|
|
proxy_http_version 1.1;
|
2022-12-05 03:13:27 +01:00
|
|
|
proxy_buffering off;
|
2022-12-05 01:38:51 +01:00
|
|
|
proxy_pass_header Server;
|
2022-12-05 03:13:27 +01:00
|
|
|
proxy_set_header Host $host;
|
|
|
|
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 ~* /eventbus/(.*) {
|
|
|
|
rewrite ^/eventbus/(.*)$ /$1 break;
|
|
|
|
proxy_pass http://egommerce-api-eventbus-mngmt;
|
2023-06-24 18:38:24 +02:00
|
|
|
proxy_http_version 1.1;
|
2022-12-05 03:13:27 +01:00
|
|
|
proxy_buffering off;
|
2022-12-05 01:38:51 +01:00
|
|
|
proxy_pass_header Server;
|
2022-12-05 03:13:27 +01:00
|
|
|
proxy_set_header Host $host;
|
|
|
|
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;
|
|
|
|
}
|
2022-12-05 01:38:51 +01:00
|
|
|
|
2023-06-24 18:38:24 +02:00
|
|
|
# Pass all requests to the API Gateway
|
|
|
|
location / {
|
|
|
|
proxy_pass https://egommerce-api-gw;
|
|
|
|
proxy_http_version 1.1;
|
|
|
|
proxy_pass_header Server;
|
|
|
|
proxy_set_header Host $host;
|
|
|
|
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;
|
|
|
|
client_max_body_size 0;
|
|
|
|
}
|
|
|
|
|
2023-06-24 18:35:16 +02:00
|
|
|
error_log /var/log/nginx/keshop.bieda.it-error.log;
|
|
|
|
access_log /var/log/nginx/keshop.bieda.it-access.log combined;
|
2022-12-05 01:38:51 +01:00
|
|
|
}
|
2023-06-24 18:38:24 +02:00
|
|
|
|
|
|
|
#server {
|
|
|
|
# listen 443 ssl;
|
|
|
|
# ssl_certificate /etc/letsencrypt/live/egommerce.pbiernat.dev/fullchain.pem;
|
|
|
|
# ssl_certificate_key /etc/letsencrypt/live/egommerce.pbiernat.dev/privkey.pem;
|
|
|
|
#
|
|
|
|
# server_name egommerce.pbiernat.dev;
|
|
|
|
#
|
|
|
|
# # Pass all requests to the API Gateway
|
|
|
|
# location / {
|
|
|
|
# proxy_pass https://egommerce-api-gw;
|
|
|
|
# proxy_http_version 1.1;
|
|
|
|
# proxy_pass_header Server;
|
|
|
|
# proxy_set_header Host $host;
|
|
|
|
# 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;
|
|
|
|
# client_max_body_size 0;
|
|
|
|
# }
|
|
|
|
#
|
|
|
|
# error_log /var/log/nginx/egommerce.pbiernat.dev-error.log;
|
|
|
|
# access_log /var/log/nginx/egommerce.pbiernat.dev-access.log combined;
|
|
|
|
#}
|