leantime icon indicating copy to clipboard operation
leantime copied to clipboard

Not serving css js images files with nginx proxy setup

Open flashery opened this issue 3 years ago • 5 comments

I tried installing this docker container on my ec2 instance machine with NGINX web server. But the static file is not displaying on my site when using HTTPS.. https://lt.tastysites.dev

What seems to be lacking here? can you help?

here is the nginx config

upstream leantime {
        server  localhost:8881;
}


server {
       listen 80;
       gzip on;
       gzip_types application/javascript image/* text/css;
       gunzip on;

	server_name lt.tastysites.dev;


	location / {
    		root /var/www/html/public;
		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;
		proxy_set_header X-Forwarded-Host $host:$server_port;
        	proxy_set_header X-Forwarded-Server $host;
        	proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
		proxy_pass http://leantime;
	}

    	listen 443 http2 ssl; # managed by Certbot
        lets encrypt certs here.....

}

flashery avatar May 08 '21 16:05 flashery

Seems the CSS files load via http instead of https. Can you set the siteURL in the config file to be https://lt.tastysites.dev

On Sat, May 8, 2021 at 12:08 PM Yves Gonzaga @.***> wrote:

I tried installing this docker container on my ec2 instance machine with NGINX web server. But the static file is not displaying on my site. https://lt.tastysites.dev/install

What seems to be lacking here? can you help?

here is the nginx config

server { listen 80; gzip on; gzip_types application/javascript image/* text/css; gunzip on;

server_name lt.tastysites.dev;

location / { root /var/www/html/public; 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; proxy_set_header X-Forwarded-Host $host:$server_port; proxy_set_header X-Forwarded-Server $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_pass http://leantime; }

	listen 443 http2 ssl; # managed by Certbot
    lets encrypt certs here.....

}

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/Leantime/leantime/issues/774, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALG4EFWQDL7XO4OUKN4DUJDTMVOXFANCNFSM44NSLFAA .

marcelfolaron avatar May 08 '21 16:05 marcelfolaron

@marcelfolaron what do you mean this line proxy_pass http://leantime;? I updated the config above that line is an upstream config.

flashery avatar May 08 '21 17:05 flashery

Did you ever solve this problem? @flashery

sdevkota avatar Feb 22 '22 00:02 sdevkota

Set parameter $appUrl = "https://yousite.name" as you case in configuration.php

susenin avatar Apr 01 '22 11:04 susenin

I'll jump on this issue because I have a similar problem. URL is https://leantime.atjb.link/

I can access everything just fine without using the Nginx forwarding via the IP http://64.227.116.71:84

Have tried adding this:

https://github.com/Leantime/leantime/blob/master/nginx.conf

to my nginx config in nginx proxy manager, replacing all domain.example.com with leantime.atjb.link - this breaks the proxy.

I'm not super advanced at this kind of stuff, so some handholding would be appreciated!

// Edit Pulled the VMS down because they were wasting money while things weren't working, but if there are some suggestions please drop me a line and I'll recreate them.

atjbramley avatar May 26 '22 16:05 atjbramley

We fixed a few of the redirect issues a while abck. So this should work now

marcelfolaron avatar Aug 22 '22 02:08 marcelfolaron