rvaidun / befake

view bereals without posting your own :)
286 stars 125 forks source link

Site reloads every 60 secoends #123

Closed LOGODERKING closed 1 year ago

LOGODERKING commented 1 year ago

I host the befake on my vps with nginx. But every 60 seconds the tab reloads. It's not bug or something but its annoying for me. Especially if i want to post my bereal etc. Is there any way to fix that?

I keep the website only by a systemd file.

/etc/systemd/system/befake.service

[Unit]
Description=Befake-Server
After=nginx.service

[Service]
WorkingDirectory=/var/www/befake
ExecStart=/usr/bin/npm run dev
Restart=always

[Install]
WantedBy=multi-user.target
rvaidun commented 1 year ago

have no idea honestly but FYI npm run dev starts a development server not intended for a prod environment. you'd probably want to run npm run build which will generate the dist folder that contains the raw javascript and html. then u can point ur nginx server to the index.html file in the dist folder.

LOGODERKING commented 1 year ago

ok i did now what you said but i cant get nginx to get the file. I get the error: Uncaught TypeError: Failed to resolve module specifier "vue". Relative references must start with either "/", "./", or "../".. and for the index.html file in the dist folder i get the error: GET https://DOMAIN/assets/index.c8d99a7c.js net::ERR_ABORTED 404. Can you help me with that? My nginx.conf file looks like this:

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

    listen 80;
    server_name DOMAIN;
    return 301 https://$server_name$request_uri;

}

server {
    listen 443 ssl http2;
    server_name DOMAIN;

    root /var/www/befake;
    index index.html;

    listen [::]:443 ssl; # managed by Certbot
    ssl_certificate /etc/letsencrypt/live/DOMAIN/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/DOMAIN/privkey.pem; # managed by Certbot
    include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot

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

    server_name DOMAIN;
    listen 80;
    return 404; # managed by Certbot
}

I replaced btw. my domain with the word Domain here.

rvaidun commented 1 year ago

idk i've never worked with nginx before. maybe root should be set to /var/www/befake/dist? not sure