fix: proxy mode with on different port not working

This commit is contained in:
antebrl
2025-01-02 19:31:57 +00:00
parent f2f86fe88d
commit 59e93fb629
2 changed files with 1 additions and 11 deletions

View File

@@ -29,7 +29,7 @@ module.exports = {
return;
}
const proxyBaseUrl = `${req.headers['x-forwarded-proto'] ?? req.protocol}://${req.get('host')}/proxy/`;
const proxyBaseUrl = '/proxy/';
const rewrittenBody = ProxyHelperService.rewriteUrls(body, proxyBaseUrl, headers, targetUrl).join('\n');
//res.set('Content-Type', 'application/vnd.apple.mpegurl');

View File

@@ -8,13 +8,6 @@ http {
include mime.types;
default_type application/octet-stream;
# If you are using another reverse proxy (e.g. for SSL),
# you need to set 'proxy_set_header X-Forwarded-Proto $scheme;' in its configuration
map $http_x_forwarded_proto $x_forwarded_proto {
default $http_x_forwarded_proto;
"" $scheme;
}
server {
listen 80;
@@ -28,7 +21,6 @@ http {
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 $x_forwarded_proto;
}
location /socket.io/ {
@@ -44,8 +36,6 @@ http {
proxy_pass http://backend:5000;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Proto $x_forwarded_proto;
add_header 'Access-Control-Allow-Origin' '*';
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
add_header 'Access-Control-Allow-Headers' 'Content-Type, Authorization';