Skip to content

Commit 725a5b0

Browse files
authored
Redirect to cleezy fastapi container instead of second nginx instance (#2054)
* redirect /s/ and /qr/ directly to cleezy container * cleezy-app * pass user agent * dont pass user agent * will try embed later
1 parent a86fc6f commit 725a5b0

1 file changed

Lines changed: 18 additions & 8 deletions

File tree

nginx.conf

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ http {
2222
server sce-main-endpoints:8080;
2323
}
2424

25+
upstream cleezy-app {
26+
server cleezy-app:8000;
27+
}
28+
2529
server {
2630
#re-routing http to https server
2731
listen 80 default_server;
@@ -42,16 +46,22 @@ http {
4246
# TLS protocol (remember to update to the newest protocols for best security)
4347
ssl_protocols TLSv1.2 TLSv1.3;
4448

45-
location ~ /s/(.*)$ {
46-
proxy_set_header X-Original-URL "$scheme://$host$request_uri";
47-
proxy_set_header X-Base-URL "$scheme://$host";
48-
proxy_pass http://cleezy-nginx.sce;
49+
location ~ ^/s/(?<alias>.*)$ {
50+
proxy_set_header Host $host;
51+
proxy_set_header X-Real-IP $remote_addr;
52+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
53+
proxy_set_header X-Forwarded-Proto $scheme;
54+
55+
proxy_pass http://cleezy-app/find/$alias;
4956
}
5057

51-
location ~ /qr/(.*)$ {
52-
proxy_set_header X-Original-URL "$scheme://$host$request_uri";
53-
proxy_set_header X-Base-URL "$scheme://$host";
54-
proxy_pass http://cleezy-nginx.sce;
58+
location ~ ^/qr/(?<alias>.*)$ {
59+
proxy_set_header Host $host;
60+
proxy_set_header X-Real-IP $remote_addr;
61+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
62+
proxy_set_header X-Forwarded-Proto $scheme;
63+
64+
proxy_pass http://cleezy-app/qr/$alias;
5565
}
5666

5767
location ~ /recipe/(.*)$ {

0 commit comments

Comments
 (0)