Skip to content

Commit

Permalink
Fix nginx config
Browse files Browse the repository at this point in the history
  • Loading branch information
N3cr0s1s committed Dec 6, 2024
1 parent 3daf036 commit f0c7029
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/config_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,15 @@ def create_new_config(route: str, host: str, port: str) -> str:
conf = (
"""
location /{route} {
if ($uri = "/{route}") {
rewrite ^ / break;
}
rewrite ^/{route}(/.*)?$ $1 break;
rewrite ^/{route}(/.*)$ $1 break;
proxy_pass http://{host}:{port};
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;
proxy_set_header Connection "upgrade";
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
"""
.replace("{route}", route)
Expand Down

0 comments on commit f0c7029

Please sign in to comment.