question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

HTML not rendering when behind nginx

See original GitHub issue

First of all thank you for such good project. I’m using it in docker and everything is working fine when its accessed using IP:Port. But when behind nginx I get the following html code in browser and webpage is not rendered:

<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <title>YoutubeDLMaterial</title>
  <base href="./">

  <meta name="viewport" content="width=device-width, initial-scale=1">
  
  <link href="https://fonts.googleapis.com/css?family=Roboto&display=swap" rel="stylesheet">
  <link rel="icon" type="image/x-icon" href="favicon.ico">
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
  <link href="https://fonts.googleapis.com/icon?family=Material+Icons|Material+Icons+Outlined" rel="stylesheet"/>
<link rel="stylesheet" href="styles.5112d6db78cf21541598.css"></head>
<body>
  <app-root></app-root>
<script src="runtime-es2015.7757e6af49e295bdf676.js" type="module"></script><script src="runtime-es5.7757e6af49e295bdf676.js" nomodule defer></script><script src="polyfills-es5.06526edb6162145ab1a0.js" nomodule defer></script><script src="polyfills-es2015.93d5fad15036291d32c6.js" type="module"></script><script src="main-es2015.b37a2ecdb3f1967e5c1d.js" type="module"></script><script src="main-es5.b37a2ecdb3f1967e5c1d.js" nomodule defer></script></body>
</html>

Here is my Nginx config

server {
    listen        80;
    server_name   youtubedl.example.com;
    include       conf.d/redirect_http.inc;
}
server {
    listen                  443 ssl http2;
    server_name             youtubedl.example.com;
    ssl_certificate         /etc/acme/*.example.com/certificates/_.example.com.crt;
    ssl_certificate_key     /etc/acme/*.example.com/certificates/_.example.com.key;

    include /etc/nginx/conf.d/ssl-params.inc; # SSL parameters

    location / {
        #include     conf.d/proxy_set_header.inc;
        proxy_pass  http://ip:8998;
    }
}

Let me know if you need any other logs etc. Cheers

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:12 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
crosbyhcommented, Apr 15, 2020

I think I just resolved this by adding a custom location to my NGINX config in line with your instructions for Nginx using Domain Subpath here. Does it make sense that I would have to do that even though I’m using a subdomain and not a subpath for my reverse proxy?

1reaction
Tzahi12345commented, Apr 15, 2020

@nebula-it Thank you! Feel free to open up another issue if anything else crops up.

Read more comments on GitHub >

github_iconTop Results From Across the Web

nginx running but not rendering html or php | Linode Questions
Everything was going fine, nginx seems to be up and running but my domain is not rendering a simple hello world html file...
Read more >
Nginx config - serving index.html not working - Server Fault
Basically, the root directive (inside the location block) didn't mention the full path. Also, a ; is missing at the end of index...
Read more >
Nginx not rendering style - wordpress - Stack Overflow
I am working on a simple Wordpress app and testing loadbalance on nginx and docker. The problem is that the styling of the...
Read more >
Pitfalls and Common Mistakes | NGINX
This page outlines some of the NGINX configuration issues that we see frequently and then explains how to resolve them.
Read more >
Issues with reverse proxy not displaying CSS and JS : r/nginx
Hello, I have nginx set up as a reverse proxy to a raspberry pi connected to a personal weather station. The back end...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found