Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not loading correctly when run on a remote server #1312

Closed
boi-doingthings opened this issue Mar 9, 2024 · 2 comments
Closed

Not loading correctly when run on a remote server #1312

boi-doingthings opened this issue Mar 9, 2024 · 2 comments

Comments

@boi-doingthings
Copy link

boi-doingthings commented Mar 9, 2024

I am trying to run heimdall on a remote server, to access few docker applications. despite issuing a lets encrypt cert, it shows up in a weird layout (probably due to inability in loading css/js files). The current view looks like:

image

The docker compose looks like:

  heimdall:
    image: linuxserver/heimdall
    container_name: heimdall
    volumes:
     - ./heimdall/:/config
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Asia/Kolkata
    ports:
      - 3010:80
      - 3011:443
    restart: unless-stopped

Further, the nginx conf file for the site looks like:

server {
    if ($host = heimdall.domain.tld) {
        return 301 https://$host$request_uri;
    } # managed by Certbot


    listen 80;
    server_name heimdall.domain.tld;
    return 301 https://$server_name$request_uri;


}

server {
    listen 443 ssl;
    server_name heimdall.domain.tld;


    ssl_certificate /etc/letsencrypt/live/heimdall.domain.tld/fullchain.pem; # managed by Certbot
 # manage>
    ssl_certificate_key /etc/letsencrypt/live/heimdall.domain.tld/privkey.pem; # managed by Certbot
 # man
    location / {
        proxy_pass http://localhost:3011;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection 'upgrade';
        proxy_set_header Host $host;
        proxy_cache_bypass $http_upgrade;
    }

}

It might not be an explicit issue, but looking forward for some help over here.

@5lianbian
Copy link

3011对应的是443端口,本地地址应该是https://localhost:3011 ?
这是我的nginx代理配置,看起来没有遇到问题,你可以试试
server {
listen 8888 ssl;
listen [::]:8888 ssl;
server_name heimdall.cc;
ssl_certificate /etc/nginx/conf.d/fullchain.pem;
ssl_certificate_key /etc/nginx/conf.d/privkey.pem;
location / {
proxy_pass https://127.0.0.1:40050;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
# This line is optional and may help in some cases.
proxy_set_header X-Forwarded-Port $server_port;
client_max_body_size 64M;
proxy_read_timeout 300s;
}
}

@boi-doingthings
Copy link
Author

Yeah. Updating the proxy forward headers were able to solve it for me as well.

proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Port $server_port;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

No branches or pull requests

2 participants