Can not get CSS and JS when load page



  • Hi there, the first time I install Nodebb, it's beautiful 👍

    But, after install, when I go to home, CSS and JS file not load.

    config.json

    {
        "url": "http://mydomain.com",
        "secret": "",
        "port": "4567",
        "use_port": false,
        "database": "redis",
        "redis": {
            "host": "127.0.0.1",
            "port": "6379",
            "password": "",
            "database": "0"
        }
    }
    

    nginx config

    server {
            listen 80;
            #listen [::]:80 ipv6only=on;
    
            root /var/www/nodebb/forums;
            index index.html index.htm;
    
            # Make site accessible from http://localhost/
            server_name mydomain.com;
    
            location / {
                    # First attempt to serve request as file, then
                    # as directory, then fall back to displaying a 404.
                    # try_files $uri $uri/ =404;
                    # Uncomment to enable naxsi on this location
                    # include /etc/nginx/naxsi.rules
    
    		proxy_set_header X-Real-IP $remote_addr;
    		proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    		proxy_set_header Host $http_host;
    		proxy_set_header X-NginX-Proxy true;
    
    		proxy_pass http://mydomain.com:4567/;
    		proxy_redirect off;
    
    		# Socket.IO Support
    		proxy_http_version 1.1;
    		proxy_set_header Upgrade $http_upgrade;
    		proxy_set_header Connection "upgrade";
    	}
    

    I alway use command sudo service nginx reload and ./nodebb restart with root user

    Anyone help me?

    Thank you 😄


    oh, if I type mydomain.com the CSS and JS not load (and every link in my forum will go to 404), but mydomain.com:4567 everything ok

    I don't know how 😢



  • Problem solved 😄 just edit etc/nginx/sites-available/default


Log in to reply
 


Looks like your connection to NodeBB was lost, please wait while we try to reconnect.